PDA

View Full Version : glGenBuffers execution error



sam_thedancer
09-28-2012, 03:39 AM
Greetings:
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.

at

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,
Sam

Dan Bartlett
09-28-2012, 03: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.

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

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