[vtkusers] OpenGL version error on macOS

Langer, Stephen A. (Fed) stephen.langer at nist.gov
Mon Aug 27 11:54:59 EDT 2018


Hi --



I finally need to actually solve a problem I encountered a year ago...  How do I get vtk to use the correct version of OpenGL on macOS using X11?



I downloaded and built CylinderRenderingProperties from the VTK examples site.  When I run it, it says



Warning: In /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 804

vtkXOpenGLRenderWindow (0x7fa9fa81f800): 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.



and then seg faults.



That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF.   OpenGL was provided by the MacPorts mesa and libGLU ports.  X11 was also installed via MacPorts.



If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and VTK_USE_X11=OFF, then it uses OpenGL from /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties compiles and runs correctly.



Do I need to do something special when building or using VTK to get it to find the correct version of OpenGL?



(I'm running macOS High Sierra, but the problem existed with the previous OS as well.)



Thanks.

    -- Steve


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180827/bae28fc0/attachment.html>


More information about the vtkusers mailing list