[vtkusers] bug with multiple render windows?
Frank Broicher
broicher at techinfo.rwth-aachen.de
Tue Feb 25 03:28:08 EST 2003
Hi everybody, hi Nick, John, and Nigel
first of all I think I should introduce a minimal program that produces
the memory leak. As you can see there are two windows opened that render
the same scene. When the rendering starts, memory is allocated rapidly
(on an Athlon 1.2GHz approx. 6MB per second), so the render function is
our starting point.
With best regards
Frank
//////////////////////////////////////////////
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkSphereSource.h>
#include <vtkActor.h>
#include <vtkPolyDataMapper.h>
int main ()
{
vtkRenderWindow * renWin = vtkRenderWindow::New ();
vtkRenderWindow * renWin2 = vtkRenderWindow::New ();
vtkRenderer * ren1 = vtkRenderer::New();
vtkRenderer * ren2 = vtkRenderer::New();
vtkSphereSource *sphere;
vtkPolyDataMapper *map;
vtkActor *aSphere;
renWin ->AddRenderer(ren1);
renWin2->AddRenderer(ren2);
sphere = vtkSphereSource::New();
map = vtkPolyDataMapper::New();
map->SetInput(sphere->GetOutput());
aSphere = vtkActor::New();
aSphere->SetMapper(map);
ren1->AddActor(aSphere);
ren2->AddActor(aSphere);
while (1)
{
renWin ->Render();
renWin2->Render();
}
}
//////////////////////////////////////////////
--
Dipl.-Inform. F. H. Broicher
Chair of Technical Computer Science Lehrstuhl f. Technische Informatik
RWTH Aachen University RWTH-Aachen
Ahornstraße 55, Room 2226
D-52074 Aachen
------------------------------------------------------------------------
Tel.: +49 (241) 80 23636 mailto:broicher at techinfo.rwth-aachen.de
Fax.: +49 (241) 80 22308 mailto:frank.broicher at ieee.org
------------------------------------------------------------------------
Fate, it seems, is not without a sense of irony. (Morpheus, The Matrix)
More information about the vtkusers
mailing list