Enable runtime detection of GLX, EGL and OSMesa for OpenGL context
- depends on !11415 (merged) for TPL glad
- community post https://discourse.vtk.org/t/simplified-python-wheel-for-vtk/14329
- closes #18547 (closed)
- closes #19075 (closed)
- closes #19383 (closed)
- Use
gladinstead ofglewfor loading GL extension functions because GLEW has trouble using GLX and EGL in the same build. - Replaces the
VTK::glewmodule withVTK::glad. - Removed the utility
VTK::openglmodule because it is unnecessary after the changes made tovtkOpenGLOptions.cmake - OpenGL is now loaded at runtime in desktop platforms.
For mobile and webassembly, when
VTK_OPENGL_USE_GLESisON,VTK::gladcmake finds and links to theOpenGL::GLES3library. - Support for
OSMesais now always available from VTK. Users must make sure thelibOSMesa.soorosmesa.dllis installed. - Support for
EGLis also always available from VTK in Linux and Android. Users must take care of installinglibEGLfrom the graphics driver packages. - On platforms where multiple render window backends are possible, the
vtkOpenGLRenderWindowis made the default factory override and it'sNewmethod implements runtime tests to determine what render windows can work. It basically constructs the platform implementation render window, attempts to initialize it and checks whether it was successfully intialized. - The X and EGL OpenGL render window class was updated to not call
abort. It also print warnings instead of errors when it fails to open X display. This allows us to safely test support forGLXat runtime. - Finally, the new environment variable
VTK_DEFAULT_OPENGL_WINDOWcan optionally be used to force a render window subclass at runtime. It is useful to debug support for a fallback render window on different system configuration.
Edited by Jaswant Panchumarti (Kitware)