Running mac os x c++ program working with OpenGL 3.3

后端 未结 1 1691
闹比i
闹比i 2021-01-24 10:01

I am running Mac OS X Sierra 10.12.6 (16G29). I am working on a macbook pro.

I have installed brew and the following packages:

brew install glfw3
brew in         


        
1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-24 10:45

    This is answered in the GLFW docs: http://www.glfw.org/docs/latest/window_guide.html

    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    // Should be true for macOS, according to GLFW docs, to get core profile.
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
    // According to Apple docs, non-core profiles are limited to version 2.1.
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    

    Also see: https://developer.apple.com/opengl/OpenGL-Capabilities-Tables.pdf

    0 讨论(0)
提交回复
热议问题