问题
GLEW is just and extension library or it contains OpenGL ES 2.0 implementation as well?
The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file.
I am confused as I find the following in glew.h
:
#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram)
where __glewLinkProgram
is
GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram;
where PFNGLLINKPROGRAMPROC
is obtained from a lib
or a dll
, I guess. I cannot find it anywhere.
回答1:
The first line of your quote states what GLEW is:
The OpenGL Extension Wrangler Library (GLEW) is a ... extension loading library.
It loads OpenGL extension functions from the OpenGL implementation (typically provided by GPU drivers). It doesn't implement them themselves.
Those PFN...
typedefs are provided by glext.h
and are function pointer types. GLEW simply defines some variables to hold the function pointers, and to load them using using the wglGetProcAddress
or glXGetProcAddress
functions.
回答2:
The official version of glew does not support OpenGL ES at all, only desktop OpenGL. However, some unofficial adaptations / forks of glew have sprung up, such as Linaro's glew-es, that do support OpenGL ES.
来源:https://stackoverflow.com/questions/29492694/glew-is-just-and-extension-library-or-it-contains-opengl-es-2-0-implementation-a