我想通过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。)
为什么没有像added in API level 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
}
可能是什么问题?