[vtk-developers] Problem using VTK in a Cocoa application with the latest VTK (october 26th and later).

Mathieu Coursolle mcoursolle at rogue-research.com
Tue Oct 30 17:26:53 EDT 2007

Hi VTK developpers,

I have been investigating a bit, and here is what I noticed.

The way SimpleCocoaVTK is done right now calls 
vtkRenderWindowInteractor::Initialize() before it is rendered
the first time.

At that point, CreateAWindow in vtkCocoaRenderWindow is called.
It doesn't matter if the window is created of not. However, OpenGLInit()
is called, which calls ReadOpenGLExtensions. That seems to required that
the renderWindow been rendered once at that point (which is not the case).
If not, it calls render. However, render looks if OnScreenInitialized has
been set to 1. It has not since we are still in CreateAWindow (it is set
at the next line). 
Since it has not, it calls CreateAWindow again (which overwrites the one
we are using)!

Is that a bug?



Original mail

Hi VTK developpers,

We developped a Cocoa application using VTK in an custom NSView.
However, it stopped working since last Friday (october 26th).

If we use october 25th build, it works all right, but our render
window will not appear if we use a newer version. The code is based 
on SimpleCocoaVTK  (<http://www.rogue-research.com/VTK/simpleCocoaVTK.html>), 
which has the same problem as we do if using the latest VTK (October
30th - 15h30).

The vtkRenderWindow disappear at launch. In fact, you can see the render
window for
a really short period of time before it disappear.

There is no VTK test which covers that issue (create the view for
vtkRenderWindow), so the dashboard 
probably did not react to the changes. However, we have been using that
code for
the last months without any problem.

Does anyone knows what is the cause of that problem. If so, is there a
way to solve it? 

We are testing on Mac OSX 10.5.


Mathieu Coursolle                   mcoursolle at rogue-research.com
Rogue Research                      www.rogue-research.com 
Montréal, Québec, Canada

More information about the vtk-developers mailing list