Why is eglMakeCurrent() failing with EGL_BAD_MATCH?

If your getting this error but not dealing with this surface or texture stuff, go to run and type .android go to AVD and your current Emulator delete the user-date file usually on .img file, restart your emulator then test. This works for me, if it happens on while testing on your device, clear the data and restart your app. Cheers for those who find this helpful.


Ah, something I actually know something about. ;) [Having spent best part of 5 years working on various EGL implementations].

I'm pretty certain your surface is a different format to the actual display surface. I'm not sure exactly WHAT the difference would be, or what you need to change. EGL_DEPTH_SIZE perhaps? You could try enumerating the modes that are available and see if any look "likely". I know, it's a bit of a pain, but I've been there done that a few times in the past - with the difference that I could usually look through the EGL source code and figure out what I'd done wrong... ;)


Ensure you have set EGL_PBUFFER_BIT for the EGL_SURFACE_TYPE in the attributes passed into eglChooseConfig() call. It's work for me