glMapBuffer undeclared in OpenGL-ES 2.0

前端 未结 2 1747
醉梦人生
醉梦人生 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:45

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

    0 讨论(0)
  • 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 <string.h>)

    0 讨论(0)
提交回复
热议问题