Restoring the C++Builder visual component from VTK 7 and 8

I have now compiled and linked the old Borland VTK 5 component against VTK 9.3.

BTW perhaps “Borland” should be replaced with “VCL” instead of “Embarcadero”. I will determine this with others. Any suggestions?

That has worked so far.
The component can be installed and used in a C++Builder Win64x application.
There is still a problem at the moment, probably with the initialization.

I use these lines:

#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2);
VTK_MODULE_INIT(vtkInteractionStyle);
VTK_MODULE_INIT(vtkRenderingFreeType);

They were enough for the component to work with VTK 7.1.

Now the call

vtkVCLRenderWindow->GetRenderWindow();

fails and works on the second call.
After the second call I can use GetRenderWindow() or GetRenderer() without any problems.
Also this works:

Renderer1 = vtkVCLRenderWindow->GetRenderer();
Renderer1->SetBackground(rgb);

If anyone has any ideas, I would be grateful.
At the moment I think something is not initialized.
I have to try to debug this.

Nevertheless I will now try to build a larger project using VTK extensively with the new compiler bcc64x and VTK 9.3. More on that soon.