[vtkusers] Rendering into pre-existing OpenGL-window without any vtkRenderWi ndow-Instance

Lisa Avila lisa.avila at kitware.com
Wed May 12 15:05:27 EDT 2004


This is already possible - you just need to work with the vtkRenderWindow 
down at the subclass level - for example, vtkWin32OpenGLRenderWindow on 
Windows. There are some ivars that can be set with existing windows. Keep 
in mind that you'll need to do some extra things such as not clearing the 
window and not swapping the buffers if you are doing that elsewhere.

Lisa



At 05:53 AM 5/12/2004, John Biddiscombe wrote:
>Your best bet would be to modify vtkRenderWindow (subclasses) to have some
>new methods which allow you to pass in a pre-existing window/rendering
>context and bypass all the window creation/initialization code. Then you'd
>in principle be able to associate an interactor, renderer and all the rest
>with it and use it just like any other vtk renderwindow.
>
>JB
>
>
>
>----- Original Message -----
>From: "Saeger, Marian" <Marian.Saeger at eads.net>
>To: <vtkusers at vtk.org>
>Sent: Wednesday, May 12, 2004 10:23 AM
>Subject: [vtkusers] Rendering into pre-existing OpenGL-window without any
>vtkRenderWi ndow-Instance
>
>
> > Hi!
> >
> > Similar questions have been raised before, but not exactly this one - and
> > existing solutions aren't nailing down my problem.
> >
> > So I would be thankful, if anyone could give me a hint on this one:
> >
> > I want vtk to render into a pre-existing OpenGL-window without having to
> > create a vtkRenderWindow instance. I.e., I want to use glut to create a
> > window and then tell my vtkRenderer-Instance just to render into that
> > window.
> >
> > But for that, I would need a vtkRenderer who doesn't care about a
> > RenderWindow and just creates gl-function-calls - unfortunately, as I see
> > it, vtkRenderer assumes that there _is_ a RenderWindow associated with it,
> > so my idea isn't applicable.
> >
> > Next idea was to create a vtkRenderWindow-Instance and assign a new
> > Device-/Render-Context via SetContextId(), SetDisplayId() and
> > SetDeviceContext() - methods. But that methods are Win32-specific - which
>is
> > not what I want.
> >
> > Another drawback would be, that I can't use any Interactor without having
>a
> > RenderWindow-Instance to assign to it - am I right?!?
> >
> > Is anybody out there with a similar problem and could give me some tips?
> > What would be the best solution - to create a specific RenderWindow, or to
> > subclass vtkRenderer to create a "GimmePlainGL-class" to suits my needs?!?
> > =|
> >
> >
> > Thanks in advance!
> >
> > Greetings, Marian
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list