小编Coo*_*ill的帖子

Android:GLES20:称为未实现的OpenGL ES API

我在尝试使用developer.android.com提供的GLES20示例时遇到"调用未实现的OpenGL ES API"错误.我修改了样本.原因是因为我在GLSurfaceView.BaseConfigChooser.chooseconfig中得到了IllegalArgumentException,所以我换了 mGLSurfaceView.setEGLContextClientVersion( 2 );

新的OnCreateMethod:

protected void onCreate( Bundle savedInstanceState )
{
    super.onCreate( savedInstanceState );
    mGLSurfaceView = new GLSurfaceView( this );

    mGLSurfaceView.setEGLConfigChooser( new EGLConfigChooser()
    {
        @Override
        public EGLConfig chooseConfig( EGL10 egl, EGLDisplay display )
        {
            EGLConfig[] configs = new EGLConfig[1];
            int[] num_config = new int[1];

            boolean check = false;

            int[] configSpec = { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };

            check = egl.eglInitialize( display, new int[] { 2, 0 } );

            if ( !check )
                return null;
            check = false;

            check …
Run Code Online (Sandbox Code Playgroud)

android opengl-es

20
推荐指数
1
解决办法
4万
查看次数

标签 统计

android ×1

opengl-es ×1