1

I am trying to learn OpenGL ES 2.0, following a basic tutorial

http://www.droidnova.com/android-3d-game-tutorial-part-ii,328.html

This is the constructor of my GLSurfaceView derivation

public FirstOpenGLSurfaceView(Context context){
        super(context);
        // Set the Renderer for drawing on the GLSurfaceView
        setEGLContextClientVersion(2);
        _renderer = new FirstOpenGLRenderer();
        setRenderer(_renderer);
    }

After some experimentation, I have concluded that the project will fail to run properly if a call to seteglcontextclientversion(2) is issued (comment out this line of code and the rendering works.) Logcat indicates "Called unimplemented OpenGL ES API" whenever an attempt is made to run the above method.

I have updated the manifest and followed all of the advice in this post here... (Including the manifest.xml settings)

Android: GLES20: Called unimplemented OpenGL ES API

I have heard the suggestion that this may indicate that OpenGL ES 2.0 is not available on the devices in question (or that the emulator is being used.) I do not believe this to be true in this case, as when I run the following code... (Found in a few tutorials, I trust this code to be telling the truth)

// Check if the system supports OpenGL ES 2.0.
final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

The value of supportsEs2 is 'true' and this applies on three independent devices, namely

  • Samsung Galaxy Tab 10.1 - Android 3.2 with 2.6.36.4 Kernel
  • Google Nexus S - Android 4.0.4 - Kernel 3.0.27
  • Samsung Galaxy S3 - Android 4.0.4 with Kernel 3.0.15

Has anyone experienced this before?

Community
  • 1
  • 1
Paul Maidment
  • 1,024
  • 2
  • 10
  • 14
  • Do you have the for gles in the manifest? I'm not sure if it makes a difference, but the language could possibly imply that without this the device will only support 1.0. I'm not sure if that's the case. http://developer.android.com/guide/topics/manifest/uses-feature-element.html#glEsVersion – Tim Jun 06 '12 at 01:34
  • @Tim in the manifest (also tried with SDK version 8, same result) – Paul Maidment Jun 06 '12 at 01:39
  • I have had issues that OpenGL 2.0 wont run after OpenGL 1.0 in the same app. – Daniel Ryan Jul 11 '12 at 03:40

1 Answers1

0

I was also facing the same problem on my XOLO a500s, and using setEGLConfigChooser() solved my problem:

myGLSurface.setEGLConfigChooser(5, 6, 5, 0, 24, 8);
myGLSurface.setEGLContextClientVersion(2);
myGLSurface.setRenderer(new MyGLRenderer());

Where I got the values for setEGLConfigChooser(redSize, greenSize, blueSize, alphaSize, depthSize, stencilSize) from:

http://gfxbench.com/result.jsp

amuTBKT
  • 1
  • 2