I am working to implement an OpenGL ES 2.0 fully in C++ for Android.
Currently our program runs without JNI or any java class in the project, using instead only NativeActivity.
Focusing on the application rendering part itself, we got a simple method:
renderWorld()
{ GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f,
-0.5f, -0.5f, 0.0f,
0.5f, -0.5f, 0.0f };
glClear ( GL_COLOR_BUFFER_BIT );
glVertexAttribPointer ( 0, 3, GL_FLOAT, GL_FALSE, 0, vVertices );
glEnableVertexAttribArray ( 0 );
glDrawArrays (GL_TRIANGLES, 0, 3 );
}
In Android.mk was included:
LOCAL_LDLIBS := -landroid -llog -lEGL -lGLESv1_CM -lOpenSLES -lGLESv2
And in AndroidManifest.xml is informed:
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
So, the program debugs and compiles with no problem. When set to run, comes the message:
error libEGL called unimplemented OpenGL ES API
The Forum gives a suggestion workable for java - Android: GLES20: Called unimplemented OpenGL ES API , including to the code the command setEGLContextClientVersion:
GLSurfaceView surfaceView = new GLSurfaceView(this);
surfaceView.setEGLContextClientVersion(2);
However, the setEGLContextClientVersion is kind of a wrapper method meant for java.
The setEGLContextClientVersion does not belong to OpenGL ES native, and can not be applicable for native C++ OGLES development.
Therefore, I used instead:
const EGLint attribList[] = {EGL_CONTEXT_CLIENT_VERSION, 2,EGL_NONE};
mContext = eglCreateContext(mDisplay, lConfig, EGL_NO_CONTEXT,attribList);
But the error has not gone away yet.