未定义参考glBindVertexArrayOES,glGenVertexArraysOES,在eclipse glDeleteVertexArraysOES [英] undefined reference glBindVertexArrayOES,glGenVertexArraysOES,glDeleteVertexArraysOES in eclipse

查看:3218
本文介绍了未定义参考glBindVertexArrayOES,glGenVertexArraysOES,在eclipse glDeleteVertexArraysOES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图编译C ++ code与Android NDK,但这些错误不会消失

Trying to compile C++ code with Android NDK but these errors wont go away

undefined reference to glBindVertexArrayOES
undefined reference to glGenVertexArraysOES
undefined reference to glDeleteVertexArraysOES 

在.mk文件中写道:

LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lz  -landroid -lEGL

所有其它功能是完全发现,我需要声明任何事情,使这些工作?

All other function are found perfectly, do i need to declare anything to make these work?

推荐答案

此功能在基地的OpenGL ES规范,所以它们不会被默认定义,但提供作为扩展名。

This functions are not in base opengl es specification, so they are not defined by default, but offered as extensions.

如果您使用的设备支持这个扩展,你可以得到的功能phsical地址和一个函数指针使用它。

If the device you use supports this extension, you can get the phsical address of the functions and use it by a function pointer.

应该这样看:

PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES;
PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOES;
PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOES;
PFNGLISVERTEXARRAYOESPROC glIsVertexArrayOES;

glGenVertexArraysOES = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress ( "glGenVertexArraysOES" );
glBindVertexArrayOES = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress ( "glBindVertexArrayOES" );
glDeleteVertexArraysOES = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress ( "glDeleteVertexArraysOES" );
glIsVertexArrayOES = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress ( "glIsVertexArrayOES" );

比你可以使用的功能。只是不要忘了此绑定发生在运行时,因此检查,如果这功能的支持是一个好主意。如果设备不支持,指针为0。

than you can use the functions. Just not forget this binding happens on runtime, so checking if this functions are supported is a good idea. If device does not support, the pointers will be 0.

这篇关于未定义参考glBindVertexArrayOES,glGenVertexArraysOES,在eclipse glDeleteVertexArraysOES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆