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 glad instead of glew for loading GL extension functions because GLEW has trouble using GLX and EGL in the same build.
  • Replaces the VTK::glew module with VTK::glad.
  • Removed the utility VTK::opengl module because it is unnecessary after the changes made to vtkOpenGLOptions.cmake
  • OpenGL is now loaded at runtime in desktop platforms. For mobile and webassembly, when VTK_OPENGL_USE_GLES is ON, VTK::glad cmake finds and links to the OpenGL::GLES3 library.
  • Support for OSMesa is now always available from VTK. Users must make sure the libOSMesa.so or osmesa.dll is installed.
  • Support for EGL is also always available from VTK in Linux and Android. Users must take care of installing libEGL from the graphics driver packages.
  • On platforms where multiple render window backends are possible, the vtkOpenGLRenderWindow is made the default factory override and it's New method 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 for GLX at runtime.
  • Finally, the new environment variable VTK_DEFAULT_OPENGL_WINDOW can 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)

Merge request reports

Loading