[vtkusers] vtk-7.1 openGL 2.0 crash

Taron taron2000 at gmx.de
Mon Jul 24 02:45:59 EDT 2017


To the compatibility problems with the new backend on machines that do not
have OpenGL 3.2 like virtual machines.  We solved the problem here (for
windows only, but I dont see why it should not work under linux as well)
like this:

We built the latest MESA driver under Windows and tested the application
with that. Everything runs fine but slow since it is a software renderer. To
test it you can simply copy the opengl32.dll (and maybe the swrAVX dlls) in
the folder of you executable.

When everything works we set up mechanism to load the system opengl when a
3.2 OpenGL context is available and otherwise load the MESA driver.

To do so we build VTK with the Linker-Option /DELAYLOAD:opengl32.dll
This will delay the loading of the specified DLL to the first call instead
of on application start up.
This gives you the chance to use SetDLLDirectory to point to the folder
where the MESA drivers are stored when no sufficient opengl is found and
thus the program will use the mesa drivers.

Now the tricky part is to detect if opengl 3.2 is available. To do so you
need to create a opengl context and see if it worked or failed. To create a
context you have to load the opengl32.dll. This is bad because we want to
switch that. The easiest solution for us was to write a very small program
(<200 SLOC) which checks if opengl in a certain version is available on the
system, since it can load the system opengl32.dll. We call this checker
program on startup of the main application and then decide which DLL to load
for the main app.



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtk-7-1-openGL-2-0-crash-tp5744014p5744134.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list