Code example for EGL10

Methods: eglGetErroreglSwapBuffers

0
	 * Display the current render surface. 
	 *  
	 * @return false if the context has been lost. 
	 */ 
	public boolean swap() { 
		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.mEGLWindowSurfaceFactory.destroySurface(this.mEgl, this.mEglDisplay, this.mEglSurface);
			this.mEglSurface = null;
Contextual code suggestions in your IDE  Get Codota for Java