1

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.

Jserra
  • 159
  • 1
  • 9

1 Answers1

0

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.

ashleysmithgpu
  • 1,867
  • 20
  • 39
  • I think you are right, but on the Nexus 4/5, GL_OES_mapbuffer is not amongst the extensions available. It is, however, on the Nexus S (why?). Maybe I should try alternatives to glMapBufferOES that work on most android devices... but I guess that is another question. – Jserra Jul 23 '14 at 12:53
  • That is strange, if you look at http://gfxbench.com/device.jsp?benchmark=gfx27&os=Android&api=gl&D=Google+Nexus+S&testgroup=info and open the OpenGL ES 2.0 tab you can see GL_OES_mapbuffer in the list. Maybe the extensions change depending on the GL version? You could always check if the entry points exist and ignore the string check. – ashleysmithgpu Jul 23 '14 at 13:03
  • 1
    Yes, actually it works on NexusS, but not on nexus 4/5, and in fact that extension is not available on nexus 4/5, so It is coherent. What I did, in the end, is replace the calls to glMapBuffer + memcpy with glBufferSubdata calls. As glBufferSubdata is not an extension, it should work on every device capable of GL. – Jserra Jul 24 '14 at 08:19