Code example for EGL10

Methods: eglGetErroreglSwapBuffers

	 * Display the current render surface. 
	 * @return false if the context has been lost. 
	public boolean swapBuffers() { 
		this.mEGL.eglSwapBuffers(this.mEGLDisplay, this.mEGLSurface);
		/* Always check for EGL_CONTEXT_LOST, which means the context and all 
		 * associated data were lost (For instance because the device went to sleep). 
		 * We need to sleep until we get a new surface. */ 
		return this.mEGL.eglGetError() != EGL11.EGL_CONTEXT_LOST;
	public void destroySurface() { 
		if (this.mEGLSurface != null && this.mEGLSurface != EGL10.EGL_NO_SURFACE) {
			this.mEGL.eglMakeCurrent(this.mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
			this.mEGL.eglDestroySurface(this.mEGLDisplay, this.mEGLSurface);
			this.mEGLSurface = null;
Connect your IDE to all the code out there  Get Codota for Java