Author Topic: Problem with OpenGL ES 2.0  (Read 2162 times)

Offline ndr123

  • byte
  • *
  • Posts: 14
    • View Profile
Problem with OpenGL ES 2.0
« on: December 19, 2011, 04:27:14 pm »
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:
Code: [Select]
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
Code: [Select]
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12258
    • View Profile
    • http://www.jpct.net
Re: Problem with OpenGL ES 2.0
« Reply #1 on: December 19, 2011, 04:54:04 pm »
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?

Offline ndr123

  • byte
  • *
  • Posts: 14
    • View Profile
Re: Problem with OpenGL ES 2.0
« Reply #2 on: December 19, 2011, 05:27:30 pm »
This is the logcat output concerning OpenGL
Code: [Select]
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
Code: [Select]
// Enable the OpenGL ES2.0 context
setEGLContextClientVersion(2);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12258
    • View Profile
    • http://www.jpct.net
Re: Problem with OpenGL ES 2.0
« Reply #3 on: December 19, 2011, 07:42:18 pm »
Make sure that you are using the FrameBuffer-constructor without the gl context, i.e. the one that takes the resolution only.

Offline ndr123

  • byte
  • *
  • Posts: 14
    • View Profile
Re: Problem with OpenGL ES 2.0
« Reply #4 on: December 19, 2011, 09:07:19 pm »
Thanks, it solved.  :)