Code example for EGL10

Methods: eglCreateWindowSurface, eglDestroySurface, eglMakeCurrent

0
            { 
                /* 
                 * Unbind and destroy the old EGL surface, if 
                 * there is one. 
                 */ 
                mEgl.eglMakeCurrent( mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT );
                mEgl.eglDestroySurface( mEglDisplay, mEglSurface );
            } 
 
            /* 
             * Create an EGL surface we can render into. 
             */ 
            mEglSurface = mEgl.eglCreateWindowSurface( mEglDisplay, mEglConfig, holder, null );
 
            /* 
             * Before we can issue GL commands, we need to make sure 
             * the context is current and bound to a surface. 
             */ 
            mEgl.eglMakeCurrent( mEglDisplay, mEglSurface, mEglSurface, mEglContext );
 
 
            GL gl = mEglContext.getGL();
            return gl;
        }