如何解决glVertexAttribDivisor 不存在
函数 glVertexAttribDivisor
与 CMake 一起使用时 - 它只是在编译期间抛出以下错误,这意味着该函数未导入。
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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。