这个异常也是别人玩我的游戏的过程中抛出的,我自己是没有重现它,所以不知道具体的步骤。 只是想问问有没有人也遇到过这个问题,同时有没有什么好的解决方案。
异常栈:
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at com.zlimits.suishenbb.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1214)
at com.zlimits.suishenbb.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1172)
at com.zlimits.suishenbb.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1575)
at com.zlimits.suishenbb.GLSurfaceView$GLThread.run(GLSurfaceView.java:1312)
查了一下http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=1418&sid=1a1b527eb8fed303c413bf48840b025f&start=40,有个人这么说的,我没看懂:
by makush » Wed Nov 30, 2011 3:37 pm
pmalolepsy wrote:How did you do that? Did you have to create a custom libgdx build?
I removed gdx-backend-android.jar from my Android sub-project and unzipped in gdx-backend-android-sources.jar. There is createGLSurfaceView method in AndroidGraphics, which chooses the rendering view. In plain LibGDX it creates GLSurfaceViewCupcake only for API 4 and below to workaround rendering problems with GLSurfaceView in API 3-4 (DefaultGLSurfaceView extends from GLSurfaceView). My current assumption is that not only GLSurfaceView in API 3-4 is bugged, but we need to replace it also for API 5-10. Hopefully someone is able to tell if I am on right tracks.
If I understood correctly AndEngine framework uses custom SurfaceView only instead of GLSurfaceView, thus, it does suffer from this crash