/* * Unbind and destroy the old EGL surface, if * there is one. */ egl.eglMakeCurrent(dpy, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); egl.eglDestroySurface(dpy, surface); } /* * Create an EGL surface we can render into. */ surface = egl.eglCreateWindowSurface(dpy, config, mHolder, null); /* * Before we can issue GL commands, we need to make sure * the context is current and bound to a surface. */ egl.eglMakeCurrent(dpy, surface, surface, context); /* * Get to the appropriate GL interface. * This is simply done by casting the GL context to either * GL10 or GL11.