2

我想通过Debug Output调试我的 OpenGL 实现。我有几个平台的界面。在桌面上,glGetDebugMessageLog调用照常工作。

但在 Android 上,我收到此错误:

java.lang.UnsupportedOperationException: not yet implemented
at android.opengl.GLES32.glGetDebugMessageLog(Native Method)
at com.rebo.opengles.ExampleInstrumentedTest.testOpenGLES32(ExampleInstrumentedTest.java:45)
at java.lang.reflect.Method.invoke(Native Method)
// <23 internal calls>
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:384)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2145)

我还在两个使用 OpenGL ES32 (Android O + P) 的设备上检查了它。(AVD 模拟器还不能支持 OpenGL ES 3.2。)

为什么该方法没有实现,因为它已经添加到 API 级别 24 中?我创建了一个新项目(最低 API 24)并在 InstrumentedTest 部分测试了代码。

@Test
public void testOpenGLES32() {
    int numErrors = 10; // Number of errors I want to receive.

    IntBuffer sources = IntBuffer.allocate(numErrors);
    IntBuffer types = IntBuffer.allocate(numErrors);
    IntBuffer ids = IntBuffer.allocate(numErrors);
    IntBuffer severities = IntBuffer.allocate(numErrors);
    IntBuffer lengths = IntBuffer.allocate(numErrors);
    ByteBuffer messageLog = ByteBuffer.allocate(numErrors);

    GLES11.glEnable(GLES32.GL_DEBUG_OUTPUT_SYNCHRONOUS);
    GLES32.glGetDebugMessageLog(numErrors, sources, types, ids, severities, lengths, messageLog);

    // Do something with the messageLog
}

可能是什么问题呢?

4

0 回答 0