相关疑难解决方法(0)

核心资料与版本字符串?只在台面10.0.1中获得GLSL 1.3/OGL 3.0

从理论上讲,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++ opengl graphics intel glsl

8
推荐指数
1
解决办法
2895
查看次数

我怎么知道我的系统支持哪个opengl版本

看一下这个非常基本的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版本。

谢谢

opengl glfw

5
推荐指数
1
解决办法
2453
查看次数

标签 统计

opengl ×2

c++ ×1

glfw ×1

glsl ×1

graphics ×1

intel ×1