Why is my OpenGL version always 2.1 on Mac OS X?

前端 未结 1 1522
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 17:22

I\'m using GLFW 3.0 on Mac OS X 10.8, graphic card is Intel HD Graphics 5000

And my OpenGL API version is 2.1, aquired by

glfwGetWindowAttrib(window,         


        
相关标签:
1条回答
  • 2020-12-09 17:55

    You need to add both "forward_compat" and "core_profile" hints before creating the window.

    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
    glfwCreateWindow(640, 480, "Hello World", NULL, NULL );
    
    0 讨论(0)
提交回复
热议问题