注册 登录
编程论坛 C++教室

OpenGL中获取硬件能接受的顶点数据上限

OpenGLNewer 发布于 2021-01-10 22:05, 1412 次点击
运行到glGetIntegerv就会访问冲突
0x00000000 处(位于 着色器学习.exe 中)引发的异常: 0xC0000005: 执行位置 0x00000000 时发生访问冲突。
程序代码:

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>

int main() {
     int nrAttributes;
     glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &nrAttributes);
    int max;
    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
    std::cout << "Maximum nr of vertex attributes supported: " << nrAttributes << std::endl;
        std::cout << "Maximum nr of vertex attributes supported: " << max << std::endl;
    getchar();
    return 0;
}
0 回复
1