1
votes

I am working on a port from iOS to Android NDK of an OpenGL ES 1.1 app. I tested the port with my Nexus S device and it works fine, but as I tested it on newer devices (Nexus 4 and 5, for instance, but for other newer devices it happens the same) there's the error

Called unimplemented OpenGL ES API

when calling:

vbo_buffer = (GLchar*)glMapBufferOES(GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES);

For the other gl calls there is no problem, though.

Details:

I use OpenGL ES 1.1 with the glext package. If I print the opengl version it says:

07-23 10:32:51.804: D/ES1Renderer(32097): OpenGL ES Version: OpenGL ES-CM 1.1

In Android.mk:

LOCAL_LDLIBS    := -llog -lGLESv1_CM -lz

And in the manifest:

<uses-feature android:glEsVersion="0x00010001" android:required="true" />

I use the GLSurfaceView approach from java to C/C++ OpenGL, and here is the initialization

public void initGLView() {
    glView = new EAGLView(getActivity(), null);

    glView.setEGLContextClientVersion(1);
    glView.setRenderer(new ES1Renderer(glView));
}

Being EAGLView subclass of GLSurfaceView and ES1Renderer is implementing GLSurfaceView.Renderer.

Is there anything else I should set to tell the device to use OGL ES 1.1? I do not understand why it is working fine on older devices, but fails on the newer ones.

1

1 Answers

0
votes

The entry point you are talking about is not available in OpenGL ES 1.1. However the extension, GL_OES_mapbuffer may be available. I would suggest you query glGetString(GL_EXTENSIONS) for the string GL_OES_mapbuffer. Then if it is available, use:

typedef void * (*MapBufferOESType)(GLenum, GLenum);
MapBufferOESType MapBufferOES = (MapBufferOESType)eglGetProcAddress("MapBufferOES");

Then try calling this entry point.