OpenGL 3.x: Access violation when using vertex buffer object and glDrawElements(…)

可紊 提交于 2019-12-04 07:20:39

When you are using buffer objects, the last parameters in the gl*Pointer and 4th parameter in glDrawElements are no longer addresses in main memory (yours still are!), but offsets into the buffer objects. Make sure to compute these offsets in bytes! The "offsetof" macro is very helpful there.

Look at the second example on this page and compare it to what you did: http://www.opengl.org/wiki/VBO_-_just_examples

And you have one typo: GL_DTREAM_DRAW.

The method glEnableClientState(...) is deprecated! Sorry, for some reason I had overseen that fact.

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