简体   繁体   中英

libEGL called unimplemented OpenGL ES Api Android

I have looked through the solutions on stackoverflow and none of them seem to fix my problem. I have included the API in my manifest file:

<uses-sdk android:minSdkVersion="10" />
<uses-feature android:required="true" android:glEsVersion="0x00020000"/>
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".HidderActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

and my wrapper code is:

class GLSurface extends GLSurfaceView
{
  final renderer r;
  public GLSurface(Context context)

  {
      super(context);

      setEGLContextClientVersion(2);
      r = new renderer();
      setRenderer(r);
      setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
  }
}

This is the error.

Called unimplemented OpenGL ES API

Changed:

mGLView.setEGLContextClientVersion(2); -> mGLView.setEGLContextClientVersion(1);

and it worked for me.

Looks like there are some things with the Androids ability to use the 2.0 persion of OpenGL ES that hinders it from working on devices. To solve this problem I uncommented the

setEGLContextClientVersion(2);

line and it worked. This however seems to put that version to (1.1?). Depends on what you want to do, this might not be a good solution but for me making a 2D game it doesn't really matter.

It may be because you are using the GL10 instance you are getting as a parameter in onSurfaceCreated(), onSurfaceChanged() and onDrawFrame() in your Renderer implementation. Since you intend to use OpenGL ES 2.0, we can and probably not use the instance and use an alternative instead. There are alternatives!This is the reasons we see those parameters names and unUsed or similar in codes across the net!

It surely has not been documented the best possible way!

This way may be you can explore more of 3D based OpenGL.

Here is a good example on how to get started with OpenGL ES 2.0

http://androidbook.com/item/4254

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM