gpt4 book ai didi

android - eglSwapBuffers 失败 : EGL_BAD_ALLOC AndEngine Android

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:58:31 24 4
gpt4 key购买 nike

我正在使用抛出异常的 And 引擎开发游戏。其实我不知道发生异常的地方。市场上多次报道。

    java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1080)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1038)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1364)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

这个有什么解决办法吗??

最佳答案

如果您没有将 Activity 的状态转换通知给 GLSurfaceView,就会发生此错误。请参阅此处的以下段落: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.

虽然我不知道 andengine 如何处理这个问题。

关于android - eglSwapBuffers 失败 : EGL_BAD_ALLOC AndEngine Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9293241/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com