OpenGL中获取硬件能接受的顶点数据上限
运行到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; }