0

与 CMake 一起使用时的函数glVertexAttribDivisor- 它只是在编译期间引发以下错误,这意味着该函数未导入。

error: 'glVertexAttribDivisor' was not declared in this scope; did you mean 'glVertexAttrib4iv'

我目前正在使用 GLAD 加载 openGL,如下所示:

if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress)) {
    std::cout << "Failed to initialize OpenGL context" << std::endl;
    return nullptr;
}

int gladInitRes = gladLoadGL();
if (!gladInitRes) {
    fprintf(stderr, "Unable to initialize glad\n");
    glfwDestroyWindow(window);
    glfwTerminate();
    return nullptr;
}

printf("OpenGL version %i.%i\n", GLVersion.major, GLVersion.minor);打印出来OpenGL version 4.2

4

0 回答 0