glMapBuffer undeclared in OpenGL-ES 2.0

前端 未结 2 1748
醉梦人生
醉梦人生 2021-01-14 08:04

I am doing Opengl-es 2.0 in ununtu 10.10 through the use of kronos and pvrsdk .Now code

#include 
#include 
<         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 08:53

    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 )

提交回复
热议问题