Also use attribute EGL_PBUFFER_BIT in your attributes to eglChooseConfig.