Hi, I'm having a problem with OpenGL ES 2.0 on jPCT-AE. Since I used OpenGL ES 1.1 everything worked fine but since I changed to OpenGL ES 2.0 I'm getting an error where I try to draw. This is logcat output:
12-19 15:46:06.410: E/AndroidRuntime(8583): java.lang.ArrayIndexOutOfBoundsException: index=0 length=0
12-19 15:46:06.410: E/AndroidRuntime(8583): at com.threed.jpct.CompiledInstance.fill(CompiledInstance.java:1163)
12-19 15:46:06.410: E/AndroidRuntime(8583): at com.threed.jpct.Object3DCompiler.compile(Object3DCompiler.java:151)
12-19 15:46:06.410: E/AndroidRuntime(8583): at com.threed.jpct.World.compile(World.java:2055)
12-19 15:46:06.410: E/AndroidRuntime(8583): at com.threed.jpct.World.renderScene(World.java:1093)
12-19 15:46:06.410: E/AndroidRuntime(8583): at it.ball.GameViewer$GameRenderer.onDrawFrame(GameViewer.java:1201)
12-19 15:46:06.410: E/AndroidRuntime(8583): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1429)
12-19 15:46:06.410: E/AndroidRuntime(8583): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1184)
I also have in output on logcat
12-19 15:46:06.390: E/libEGL(8583): called unimplemented OpenGL ES API
Currently I'm testing on an Eee pad transformer with NVIDIA Tegra 2.
Are you sure that you've initialized 2.0 properly? Judging from the log output, it looks like as if you are still using a 1.1 context...or the other way round. Can you post the log output that shows the used gl version?
This is the logcat output concerning OpenGL
12-19 15:46:06.100: I/jPCT-AE(8583): OpenGL vendor: NVIDIA Corporation
12-19 15:46:06.100: I/jPCT-AE(8583): OpenGL renderer: NVIDIA Tegra
12-19 15:46:06.100: I/jPCT-AE(8583): OpenGL version: OpenGL ES 2.0
12-19 17:24:29.340: I/jPCT-AE(21407): OpenGL renderer initialized (using 0 texture stages)
To initialize OpenGL ES 2.0 I followed the example provided in the package and so I'm initiliazing it calling this function
// Enable the OpenGL ES2.0 context
setEGLContextClientVersion(2);
Make sure that you are using the FrameBuffer-constructor without the gl context, i.e. the one that takes the resolution only.
Thanks, it solved. :)