PDA

View Full Version : 'glMapBuffer' was not declared in this scope



saman_artorious
06-26-2013, 03:35 AM
I get the following error when I call glMapBuffer function:

error: 'glMapBuffer' was not declared in this scope

I also had a look at this page http://stackoverflow.com/questions/6567042/glmapbuffer-undeclared-in-opengl-es-2-0 but I couldn't understand it.

elFarto
06-26-2013, 04:05 AM
What the answer you linked to is saying is that the glMapBuffer function isn't actually defined as a function in the header file by default.

The normal way to access these methods is to use something like GLEW (http://glew.sourceforge.net/) to load all the extensions for you. GLEW has the glMapBuffer declared as a variable, and calls wglGetProcAddress("glMapBuffer") on Windows, to get the address of that function.

There is more information over on the wiki (http://www.opengl.org/wiki/Load_OpenGL_Functions) about this.

Regards
elFarto

saman_artorious
06-26-2013, 04:41 AM
Thanks elFarto, I did not know Glew library contains the glMapBuffer function string.