OpenGL delay load issue

I’m using VTK 8.2 and I want to use OpenGL delay load to be able to switch in software rendering when necessary.

I followed the steps described here: https://vtk.org/doc/nightly/html/vtkTestOpenGLVersion_8h.html#a863adbac1bada4e7b1e08dce13170631

Our applications are launched through a “launcher” which wrapps original exe in a another thread.

Using OpenGL delay load works when used directly on the exe, but when used in another thread it’s KO.

To test further more I put mesa dlls directly in exe folder to force software mode and I disabled call to HandleOpenGL32Issues .

With vtk built WITHOUT OpenGL delay load, it is OK either when I launch exe directly or through the launcher.

But with vtk built WITH OpenGL delay load, it is OK only when I launch exe directly, through the launcher it is KO.

So is the fact that my application is launched through another thread that is causing OpenGL dlls loading fail ?

How can I solve this issue ?

Thank you,

Best regards,

Frédéric