Access violation using VBO with glew

落花浮王杯 提交于 2019-12-01 20:31:51

Since your program fails at the first use of a VBO related function, it sounds like you either didn't initialize GLEW properly (by calling glewInit once the GL context is created and active) or your hardware just doesn't support VBOs.

Just check if your hardware supports GL_ARB_vertex_buffer_object or if the OpenGL version is at least 1.5, in which case you can use the core versions of the VBO functions (without the ARB suffix, but you still need a properly initialized GLEW for these, of course):

printf("%s\n", glGetString(GL_VERSION));
if(!strstr(glGetString(GL_EXTENSIONS), "GL_ARB_vertex_buffer_object"))
    //no VBO extension

And make sure you work with a recent graphics driver. If you work with the Windows default driver, it may only support OpenGL 1.1.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!