[vtkusers] Workaround: ChoosePixelFormat failed error

Pascal Bertram pascalbertram at gmx.de
Thu Nov 3 04:41:21 EST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It looks like nobody solved the problem. The workaround is nice and also
works for me. My problem is that I'm always getting _two_ openGL windows
with just one being responsive and correct. This is what I do:

vtkCanvas renWin = new vtkCanvas();
// ...
// some "complicate" stuff.
// ...
vtkConeSource cone = new vtkConeSource();
vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
coneMapper.SetInput(cone.GetOutput());
vtkActor coneActor = new vtkActor();
coneActor.SetMapper(coneMapper);
renWin.GetRenderer().AddActor(coneActor);
coneMapper.Update();
renWin.Render(); // -1-
renWin.GetRenderer().RemoveActor(coneActor);
renWin.GetRenderer().Clear();
renWin.GetRenderer().GetCullers().RemoveAllItems();
JFrame frame = new JFrame("Test Slice View");
frame.getContentPane().add(this, BorderLayout.CENTER);
frame.setVisible(true); // -2-

The first window shows up after the -1- line, the second after -2-.
Without the Render() call the error remains.
Since I'm new to vtk it would be nice if Christopher Bruns or somebody
else post some code how this is done better because I always have to
wait for the second window to become responsive.
Thank you very much.

Pascal Bertram
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: GnuPT-Light 0.3 by EQUIPMENTE.DE

iD8DBQFDadtBK5Pn6kusgO4RAlFeAKC9LNVK/kmcivbVd+oYUOF0cfY3bQCglMIp
3X6mjD3dDnu28RZQ6cSNy8U=
=jxah
-----END PGP SIGNATURE-----



More information about the vtkusers mailing list