我想创建 OpenGL 1.2 上下文,但我收到此错误:“无法打开 GLFW 窗口”。当我创建 3.3 或 4.3 上下文时没有问题。如何创建 1.2 上下文?
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 1);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
const GLFWvidmode * mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
WindowWidth = mode->width;
WindowHeight = mode->height;
midWindowWidth = WindowWidth / 2;
midWindowHeight = WindowHeight / 2;
window = glfwCreateWindow(WindowWidth, WindowHeight, "Quadcopter Project", glfwGetPrimaryMonitor(), NULL);
if( window == NULL )
{
fprintf( stderr, "Failed to open GLFW window. \n" );
glfwTerminate();
return -1;
}