View Full Version : glGenBuffers execution error

09-28-2012, 02:39 AM
I am learning the 3.x buffer manipulation commands (environment MS VC++ 2010, W7). Having commented out most everything else in a program, I get the execution error

Unhandled exception at 0x00000000 in BufCom.exe: 0xC0000005: Access violation.


glGenBuffers(1, buffers);

If I comment out glGenBuffers() there's no problem. So what am I doing wrong? Btw, buffers is defined by GLuint buffers[2] so it's big enough.

Thanks in advance,

Dan Bartlett
09-28-2012, 02:52 AM
It sounds like you haven't retrieved the glGenBuffers function entry point. OpenGL32.dll only exposes OpenGL 1.1 entry points + all the rest have to be retrieved using wglGetProcAddress (or alternative similarly named function for different platforms). GLEW or similar extension loading libraries will make this much easier for you.

09-28-2012, 03:48 AM
Here you go http://www.opengl.org/wiki/Getting_started
Specially this part http://www.opengl.org/wiki/Getting_started#Getting_Functions

09-28-2012, 12:51 PM
Thanks, Dan and V-man.
I forgot to put glewInit() in main so GLEW never initialized.