LibGDX IllegalStateException:无法构造帧缓冲区:不支持的格式组合

时间:2014-01-28 17:41:59

标签: java android opengl-es libgdx

我使用LibGDX编写了应用程序,并在多个设备上对其进行了测试。它可以工作,但当我将应用程序加载到Play.google时,我收到了有关错误和崩溃的信息:

完整堆栈跟踪:

java.lang.IllegalStateException: frame buffer couldn't be constructed: unsupported combination of formats 
at com.badlogic.gdx.graphics.glutils.FrameBuffer.build(FrameBuffer.java:183) 
at com.badlogic.gdx.graphics.glutils.FrameBuffer.<init>(FrameBuffer.java:97) 
at com.me.screens.DirectedGame.setScreen(DirectedGame.java:32) 
at com.me.pidgame.MyGdxGame.create(MyGdxGame.java:16) 
at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:334) 
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505) 
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

为什么会出现?

1 个答案:

答案 0 :(得分:2)

如果你看一下来源:FrameBuffer

当OpenGL上下文中gl.glCheckFramebufferStatus的结果返回GL20.GL_FRAMEBUFFER_UNSUPPORTED

时,您将看到该异常被抛出
if (result == GL20.GL_FRAMEBUFFER_UNSUPPORTED)
    throw new IllegalStateException("frame buffer couldn't be constructed: unsupported combination of formats");

当在该特定设备中不支持用于创建FrameBuffer的Pixmap.Format时,会发生这种情况。

相关问题