AndEngine
AndEngine copied to clipboard
java.lang.RuntimeException: eglSwapBuffers failed
Getting this very often (but still intermittently)
Comes in a few flavours
java.lang.RuntimeException: eglSwapBuffers failed: EGL_SUCCESS at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1085) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1043) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1369) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1123)
Similarly, the following:
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1079) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1037) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1342) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
And another:
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_CURRENT_SURFACE at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1142) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1100) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1440) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1180)
Same here, also : EGL_BAD_MATCH.
I've seen this issue on my games also. There isn't clear information on the internet to why this is happening. Most people say it's because the devices running the game are to old or don't have enough resources to load the entire game. I believe that to be true in my case. My game loads 100+ sprites into memory...
The same problem
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1229) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1187) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1514) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1267)
HI, I have a lot of EGL_SUCCESS in my applications. From my research, it should come from memory issues with the usage of big textures (e.g. more than 1024x1024). But even after a huge reductions of the textures, it still happens on low end devices...
I don't have any EGL_BAD_ALLOC though. This one is supposed to come from bad synchro between the application lifecycle and the GLSurfaceView. See the solution here: http://stackoverflow.com/questions/6039107/android-glsurfaceview-egl-bad-alloc
BaseGameActivity already has calls onPause and onResume for GLSurfaceView so http://stackoverflow.com/questions/6039107/android-glsurfaceview-egl-bad-alloc is not solution.