所以我正在构建这样的FrameBuffer(我正在使用LibGDX):
try
{
_frameBuffer= new FrameBuffer(Format.RGBA4444, (int)getWidth(), (int)getHeight(), false);
}
catch (IllegalStateException e)
{
_frameBuffer= new FrameBuffer(Format.RGBA8888, (int)getWidth(), (int)getHeight(), false);
}
(如果设备不支持RGBA4444,我会回退到RGBA8888)。
这适用于几乎所有人,但每天我的Google Analytics崩溃报告都会显示构建FrameBuffer时发生的2-4次崩溃。它也总是相同的设备型号:
以下是我收到的错误:
Thread: GLThread 17, Exception: java.lang.IllegalStateException: frame buffer couldn't be constructed: unknown error 0 at
com.badlogic.gdx.graphics.glutils.FrameBuffer.build(FrameBuffer.java:178) at
com.badlogic.gdx.graphics.glutils.FrameBuffer.<init>(FrameBuffer.java:97) at
...
我正在使用LibGDX的FrameBuffer类。在这个类中,可能会抛出许多可能的错误。请注意,我收到了最后一个(默认的没有if语句):
if (result == GL20.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)
throw new IllegalStateException("frame buffer couldn't be constructed: incomplete attachment");
if (result == GL20.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS)
throw new IllegalStateException("frame buffer couldn't be constructed: incomplete dimensions");
if (result == GL20.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)
throw new IllegalStateException("frame buffer couldn't be constructed: missing attachment");
if (result == GL20.GL_FRAMEBUFFER_UNSUPPORTED)
throw new IllegalStateException("frame buffer couldn't be constructed: unsupported combination of formats");
throw new IllegalStateException("frame buffer couldn't be constructed: unknown error " + result);
我不确定这意味着什么,除了这个错误,它不适合任何其他“类别”。