/*
 *              public void CreatePixmapSurface (EGLConfig config)
 *              {
 *                      Surface = egl.EglCreatePixmapSurface (Display, config, null ,null);
 *                      if (Surface == null || Surface == EGL10.EglNoSurface)
 *                              throw EglException.GenerateException ("EglCreatePixmapSurface", egl, null);
 *              }
 */
        public void DestroySurface()
        {
            if (eglSurface != EGL10.EglNoSurface)
            {
                IEGL10 egl = EGLContext.EGL.JavaCast <IEGL10> ();
                try     {
                    egl.EglMakeCurrent(eglDisplay, EGL10.EglNoSurface, EGL10.EglNoSurface, EGL10.EglNoContext);
                    if (!egl.EglDestroySurface(eglDisplay, eglSurface))
                    {
                        Log.Warn("AndroidWindow", "Failed to destroy surface {0}.", eglSurface);
                    }
                }
                catch (Java.Lang.IllegalArgumentException)      {
                    Log.Warn("AndroidWindow", "Failed to destroy surface {0}. Illegal Argument", eglSurface);
                }
                eglSurface = null;
            }
        }