[vtkusers] help with modules and opengl
Langer, Stephen A. (Fed)
stephen.langer at nist.gov
Thu Oct 12 15:01:08 EDT 2017
Hello --
I am belatedly updating my program to use vtk 7 or 8 instead of 5.10. There are some things that I clearly don't understand about the new architecture.
Following https://www.vtk.org/Wiki/VTK/Build_System_Migration, I have added
VTK_MODULE_INIT(vtkRenderingOpenGL2);
VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2);
before any other vtk operations. (I'm not using cmake, for unrelated reasons.)
When my program opens a graphics window, I get errors
ERROR: In /Users/langer/UTIL/VTK/VTK-7.1.1/Rendering/Core/vtkTextActor.cxx, line 113
vtkTextActor (0x7fb87c83c2b0): Failed getting the TextRenderer instance!
which I can make go away by including
VTK_MODULE_INIT(vtkRenderingFreeType);
but then I get the message
VTK is designed to work with OpenGL version 3.2 but it appears it has been given a context that does not support 3.2.
VTK will run in a compatibility mode designed to work with earlier versions of OpenGL but some features may not work.
(After that my program crashes, but it may be for unrelated reasons.)
https://www.vtk.org/Wiki/VTK/Build_System_Migration implies that I should use vtkRenderingFreeTypeOpenGL instead of vtkRenderingFreeType, but that doesn't exist. I get the error
dyld: lazy symbol binding failed: Symbol not found: __Z45vtkRenderingFreeTypeOpenGL_AutoInit_Constructv
Is there a libvtkRenderingFreeTypeOpenGL.dylib that should be part of vtk? How do I get it to build that? It doesn't exist in the directory with the rest of the vtk libraries.
The page https://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines looks like it should be helpful, but the links to the helpful mailing list threads are broken. Does someone know the correct links?
How do I know what modules I should be initializing? Have I missed something when building vtk? I'm on MacOS Sierra, using macports to install everything except vtk itself (although macport's version of vtk is not too terribly ancient, it's built without VTK_USE_X, which I need).
When building vtk, if I leave OPENGL_INCLUDE_DIR, OPENGL_gl_LIBRARY, and OPENGL_glu_LIBRARY set to the default (/System/Library/Frameworks/OpenGL.framework) , the vtk build fails with undefined symbol errors (_glXChooseFBConfig, etc). So I point them at macports' files (/opt/local/include, /opt/local/lib/libGLl.dylib, and /opt/local/lib/libGLU.dylib). Then vtk builds but doesn't find OpenGL 3.2. The Mac does support later versions of OpenGL-- how can I get vtk to use it?
Many thanks,
Steve
More information about the vtkusers
mailing list