glMapBuffer undeclared in OpenGL-ES 2.0

拈花ヽ惹草 提交于 2019-12-01 08:32:15

As with "normal" OpenGL, you have to define function pointers and explicitly load functionality that goes beyond "bare bones".

If you look at the header, you'll see the #ifdef GL_GLEXT_PROTOTYPES block, which causes the function prototype not being generated (in fact, I'm not sure why the option to generate prototypes exists at all, they are not really useful to anyone).
Following that, you see the typedef of PFNGLMAPBUFFEROESPROC. That's what you need.

You'll have to declare a global function pointer such as extern PFNGLMAPBUFFEROESPROC glMapBufferOES; and initialize it at startup (after checking presence of the extension).

Look at what libraries such as GLEW or Glee do.

(the error about memcpy is a missing #include <string.h>)

putting #include <OpenGLES/ES2/glext.h> fixed my problem

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