opengles 使用实例化的方式绘制在android studio 进行ndk编译的时候报错:error: ‘glVertexAttribDivisor’ was not declared in this scope;error: ‘glDrawArraysInstanced’ was not declared in this scope。
经过排查openges2.0不支持实例化的方式,将“#include <GLES2/gl2.h>”改为“#include <GLES3/gl3.h>”
另外需要使用gl2ext.h的时候,不能使用gl3ext.h,因为gl3ext.h是个空文件。这里可以看一下这个博客,有用的(https://www.it1352.com/154600.html)。注意添加“#define _gl2_h”防止和gl3冲突。
由于使用opengles3.0 ndk编译的时候需要将android.mk中的
LOCAL_LDLIBS := -llog -lGLESv2 改成LOCAL_LDLIBS := -llog -lGLESv3