从理论上讲,mesa 10.0.1应该支持OpenGL 3.3,但目前我只获得3.0支持.
glxinfo给出了一些令人困惑的结果......
[pdel@architect build]$ glxinfo | grep -i opengl
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.0.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.0.1
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions: …Run Code Online (Sandbox Code Playgroud) 看一下这个非常基本的C ++代码:
if(!glfwInit())
{
return -1;
}
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
window = glfwCreateWindow(640, 480, "Test", NULL, NULL);
if (window==NULL)
{
return -1;
}
glfwMakeContextCurrent(window);
std::cout << "GL_VERSION: " << glGetString(GL_VERSION) << std::endl;
Run Code Online (Sandbox Code Playgroud)
我不明白我如何“检测”我可以在行中设置的最大opengl版本:
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
Run Code Online (Sandbox Code Playgroud)
该行不能放置在glfwMakeContextCurrent:
glGetString(GL_VERSION)
Run Code Online (Sandbox Code Playgroud)
所以我的问题是我如何在程序开头检测系统支持的opengl版本。
谢谢