问题
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