我目前正在使用Ubuntu 16.04上的OpenGL开发一个项目,并且遇到了一个主要问题。在这一点上,我不知道该怎么做,因为它觉得我已经尝试了一切,以解决这个问题。C++ OpenGL着色版本错误 - 不支持GLSL x [Ubuntu 16.04]
出于某种原因,我只是着色器将无法编译,并返回以下错误:
Failed to compile vertex shader!
0:1(10): error: GLSL 4.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES`
我已经调整了着色器文件中的版本没有任何的运气。 #version 450 core
等,但我一直得到相同的结果。
仅供参考,这里是sudo glxinfo | grep "OpenGL"
输出:
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 13.1.0-devel
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 13.1.0-devel
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 13.1.0-devel
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
显示核心的OpenGL 4.5安装从glxinfo的输出,所以这是为什么不支持?
我也试着找到项目中使用的OpenGL的当前版本:std::cout << "OpenGL version: " << glGetString(GL_VERSION) << std::endl;
这导致空白返回。
我已经花了10个小时在这个单一的问题,直到现在,所以任何帮助表示赞赏!
编辑: 有没有办法强制项目/ Ubuntu使用OpenGL而不是GLSL,即完全删除GLSL(本部分)?
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 13.1.0-devel
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
根据[这](https://en.wikipedia.org/wiki/OpenGL_Shading_Language#Versions)表似乎我有两个不同版本的OpenGL安装? –