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. 
             */ 
            mEglContext = mEgl.eglCreateContext(mEglDisplay, mEglConfig,
                EGL10.EGL_NO_CONTEXT, null);
 
            mEglSurface = null;
        }