What does major and minor mean in OpenGL with GLFW?

为君一笑 提交于 2021-02-19 06:05:26

问题


I was creating an OpenGL window with GLFW on some Dell PC that used integrated graphics. I thought that major means maximum and minor means minimum. However having a restricted version range of (3,3) works but a range that contains it such as (4,2) fails.

Example:

//fails
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

//fails
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);

//success
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

//success
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);

回答1:


"Major" and "minor" are two components of a single version number, separated by a dot.

Version 4.3 is major version 4, minor version 3.

Version 3.1 is major version 3, minor version 1.

And so on.

The results of your sample code indicate that your computer probably doesn't support OpenGL 4.x contexts. You will need to stick to OpenGL 3.x or earlier.




回答2:


When you look at version numbers of things, such as 4.3, the 4 is the 'major' part of the version, and the 3 the 'minor'.



来源:https://stackoverflow.com/questions/43669408/what-does-major-and-minor-mean-in-opengl-with-glfw

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!