[vtkusers] Can I derive from vtkOpenGLRenderWindow for a yet unsupported window system?
Christian Banks
cryo80home at yahoo.com
Tue Apr 8 16:07:52 EDT 2008
Hello,
I am looking for an example or some general comments, how I can extend the vtkOpenGLRenderWindow for a very special OpenGL library (vtkXOpenGLRenderWindow is not applicable, because I want to run VTK on an embedded system with a custom window system).
Currently I am more or less duplicating vtkXOpenGLRenderWindow with changes where necessary to account for the window system that replaces X11. Compilation of the new class vtkNewOpenGLRenderWindow is successful.
Unfortunately the following call in a VTK application always results in renWin being a vtkXOpenGLRenderWindow, not the desired vtkNewOpenGLRenderWindow:
vtkRenderWindow *renWin = vtkNewOpenGLRenderWindow::New();
The reason is that New() is inherited from vtkRenderWindow::New(), which calls vtkGraphicsFactory::CreateInstance("vtkRenderWindow") which finally executes "return vtkXOpenGLRenderWindow::New();".
Is it necessary to dig through the vtkRenderWindow hierarchy and replace each occurrence of vtkXOpenGLRenderWindow with vtkNewOpenGLRenderWindow?
Or is there a way with less modifications of the vtk sources, for example overriding vtkNewOpenGLRenderWindow::New(), but how does it have to look like? I found that I cannot simply ignore the chain of calls down to vtkGraphicsFactory::CreateInstance(), but on the other hand my impression is that it is unnecessarily complicated if I have to modify several classes if all I want is to derive from vtkOpenGLRenderWindow.
Any comments are appreciated!
Thank you in advance
cryo
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080408/6d10e656/attachment.htm>
More information about the vtkusers
mailing list