编译VTK for iOS时缺少OpenGL扩展项

时间:2016-12-06 17:27:12

标签: ios vtk

我正按照https://blog.kitware.com/building-vtk-for-mobile-architectures/的说明尝试编译适用于iOS的VTK 7.1.0。

我看到以下问题:

 [ 90%] Built target vtkglew [ 90%] Building CXX object
 Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkOpenGLPolyDataMapper.cxx.o

/Users/nclex/Documents/dev/VTK/VTK-7.1.0/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx:1582:36: error: 

      use of undeclared identifier 'GL_MULTISAMPLE'

  bool multisampling = glIsEnabled(GL_MULTISAMPLE) == GL_TRUE;

GL_MULTISAMPLE在glew.h中定义,它是源代码树的一部分,但不确定为什么在编译期间没有看到它。

我在MacOS 10.12.1(Sierra)上使用Xcode 8.1。 VTK代码是位于http://www.vtk.org/download/的7.1.0链接。

1 个答案:

答案 0 :(得分:0)

vtkOpenGLPolyDataMapper.cxx似乎有一些错误。

要修复编辑,我已更换:

#if GL_ES_VERSION_3_0 != 1
  bool multisampling = glIsEnabled(GL_MULTISAMPLE) == GL_TRUE;
#else
  bool multisample = false;
#endif

#if GL_ES_VERSION_3_0 != 1 && defined GL_MULTISAMPLE
  bool multisampling = glIsEnabled(GL_MULTISAMPLE) == GL_TRUE;
#else
  bool multisampling = false;
#endif

<强>更新 git repo在同一天更新了,修复了这个。 这个项目的回购似乎没有得到很好的策划(或者至少,拉动请求在被合并之前没有经过全面测试)。