简体   繁体   English

如何使用android-ndk使用'glGenVertexArrays'

[英]how can I use 'glGenVertexArrays' using android-ndk

i'm trying to use the VertexArray with Android NDK for a project that already compiles ok and uses other Open GL ES calls ok. 我正在尝试将VertexArray与Android NDK一起用于已经编译正常并使用其他Open GL ES调用正常的项目。 For the purposes of this question let's talk about the call 'glGenVertexArrays' alone. 出于这个问题的目的,让我们单独谈谈调用“ glGenVertexArrays”。

I found the following definition in gl2ext.h: 我在gl2ext.h中找到以下定义:

GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);

it is defined behind GL_GLEXT_PROTOTYPES definition. 它在GL_GLEXT_PROTOTYPES定义后面定义。 So I defined it and used it. 所以我定义并使用了它。 It compiles fine but i'm getting link errors: undefined reference, so it seems it is missing from the lib file... 它可以很好地编译,但是我收到链接错误:未定义的引用,因此看来它在lib文件中丢失了...

So, then I tried using the typedef below in gl2ext.h: 因此,然后我尝试在gl2ext.h中使用以下typedef:

typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);

like this: 像这样:

PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays;
glGenVertexArrays = (PFNGLGENVERTEXARRAYSOESPROC) eglGetProcAddress("glGenVertexArraysOES");

and ... nothing, returns NULL. ...什么都没有,返回NULL。

I also tries "glGenVertexArrays" ... nothing, still returns NULL 我也尝试“ glGenVertexArrays” ...什么也没有,仍然返回NULL

any ideas would be appreciated. 任何想法,将不胜感激。 Thank you. 谢谢。

You are trying OpenGL ES Extensions which may or may not be supported. 您正在尝试可能或可能不支持的OpenGL ES扩展。

http://www.khronos.org/opengles/documentation/opengles1_0/html/glIntro.html http://www.khronos.org/opengles/documentation/opengles1_0/html/glIntro.html

Just because it is in the standard header doesn't mean that Android or any particular implementation actually has that API. 仅仅因为它在标准标头中并不意味着Android或任何特定实现实际上具有该API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM