eglSwapBuffers failed: EGL_BAD_ALLOC AndEngine Android

后端 未结 2 1062
小蘑菇
小蘑菇 2021-02-10 09:28

I m developing a game in And engine which throws the exception. Actually I don\'t know the point where exceptions occurs. It is reported in market many many time.



        
相关标签:
2条回答
  • 2021-02-10 10:10

    In my experience (which is specific to my Samsung Note, and no other Android device I've tested so far), is that EGL_BAD_ALLOC will be incorrectly produced by eglSwapBuffers() instead of EGL_BAD_CURRENT_SURFACE. If your code handles re-creating the surface, it should be trivial to handle this obscure case as well.

    0 讨论(0)
  • 2021-02-10 10:19

    This error can occur when you don't notify the GLSurfaceView about state transistions of your Activity. See the following paragraph from here: http://developer.android.com/reference/android/opengl/GLSurfaceView.html

    Activity Life-cycle

    A GLSurfaceView must be notified when the activity is paused and resumed. GLSurfaceView clients are required to call onPause() when the activity pauses and onResume() when the activity resumes. These calls allow GLSurfaceView to pause and resume the rendering thread, and also allow GLSurfaceView to release and recreate the OpenGL display.

    I don't know how andengine handles this though.

    0 讨论(0)
提交回复
热议问题