private void Cleanup() { if (eglDisplay != Egl.EGL_NO_DISPLAY && eglContext != Egl.EGL_NO_CONTEXT) { Egl.eglDestroyContext(eglDisplay, eglContext); eglContext = Egl.EGL_NO_CONTEXT; } if (eglDisplay != Egl.EGL_NO_DISPLAY) { Egl.eglTerminate(eglDisplay); eglDisplay = Egl.EGL_NO_DISPLAY; } }