/* * React to the creation of a new surface by creating and returning an * OpenGL interface that renders to that surface. */ public GL CreateSurface(SurfaceHolder holder) { /* * The window size has changed, so we need to create a new surface. */ if (this.mEglSurface != null) { /* * Unbind and destroy the old EGL surface, if there is one. */ this.mEgl.EglMakeCurrent(this.mEglDisplay, EGL10Consts.EglNoSurface, EGL10Consts.EglNoSurface, EGL10Consts.EglNoContext); this.mEgl.EglDestroySurface(this.mEglDisplay, this.mEglSurface); } /* * Create an EGL surface we can render into. */ this.mEglSurface = this.mEgl.EglCreateWindowSurface(this.mEglDisplay, this.mEglConfig, (Object)holder, null); /* * Before we can issue GL commands, we need to make sure the context * is current and bound to a surface. */ this.mEgl.EglMakeCurrent(this.mEglDisplay, this.mEglSurface, this.mEglSurface, this.mEglContext); GL gl = this.mEglContext.GL; if (GLSurfaceView.Instance.mGLWrapper != null) { gl = GLSurfaceView.Instance.mGLWrapper.wrap(gl); } /* Debugging disabled */ /* * if ((mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS))!= * 0) { int configFlags = 0; Writer log = null; if ((mDebugFlags & * DEBUG_CHECK_GL_ERROR) != 0) { configFlags |= * GLDebugHelper.CONFIG_CHECK_GL_ERROR; } if ((mDebugFlags & * DEBUG_LOG_GL_CALLS) != 0) { log = new LogWriter(); } gl = * GLDebugHelper.wrap(gl, configFlags, log); } */ return(gl); }
public Canvas(Javax.Microedition.Khronos.Opengles.IGL gl) : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer) { throw new NotSupportedException("The Canvas(Javax.Microedition.Khronos.Opengles.IGL) constructor is not supported on API-11+."); }