Code example for EGL10

Methods: eglChooseConfig, eglCreateContext, eglGetDisplay, eglInitialize

0
            mEgl = (EGL10)EGLContext.getEGL();
 
            /* 
             * Get to the default display. 
             */ 
            mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
 
            /* 
             * We can now initialize EGL for that display 
             */ 
            int[] version = new int[2];
            mEgl.eglInitialize( mEglDisplay, version );
 
            EGLConfig[] configs = new EGLConfig[1];
            int[] num_config = new int[1];
            mEgl.eglChooseConfig( mEglDisplay, configSpec, configs, 1, num_config );
            mEglConfig = configs[0];
 
            /* 
            * Create an OpenGL ES context. This must be done only once, an 
            * OpenGL context is a somewhat heavy object. 
            */ 
            int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
            mEglContext = mEgl.eglCreateContext( mEglDisplay, mEglConfig, EGL10.EGL_NO_CONTEXT, attrib_list );
            CCGLViewJNI.checkEglError( "After eglCreateContext", mEgl );
 
            mEglSurface = null;
        } 
 
        /*