adding this line to HelloWorld sample before setEGLConfigChooser
mGLView.setEGLContextClientVersion(2);
results in the exception below. any ideas how to fix this?
I/jPCT-AE (24633): Memory usage after compacting: 12335 KB used out of 13447 KB. Max. memory available to the VM is 65536 KB.
I/jPCT-AE (24633): Saving master Activity!
E/libEGL (24633): called unimplemented OpenGL ES API
E/libEGL (24633): called unimplemented OpenGL ES API
E/libEGL (24633): called unimplemented OpenGL ES API
I/jPCT-AE (24633): [ 1387365972966 ] - WARNING: State: 0/0/0/0/0/0/0
W/dalvikvm(24633): threadid=11: thread exiting with uncaught exception (group=0x4199d2a0)
E/AndroidRuntime(24633): FATAL EXCEPTION: GLThread 7949
E/AndroidRuntime(24633): java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
E/AndroidRuntime(24633): at com.threed.jpct.CompiledInstance._fill(CompiledInstance.java:1206)
E/AndroidRuntime(24633): at com.threed.jpct.CompiledInstance.fill(CompiledInstance.java:746)
E/AndroidRuntime(24633): at com.threed.jpct.Object3DCompiler.compile(Object3DCompiler.java:148)
E/AndroidRuntime(24633): at com.threed.jpct.World.compile(World.java:1951)
E/AndroidRuntime(24633): at com.threed.jpct.World.renderScene(World.java:1046)
E/AndroidRuntime(24633): at com.threed.jpct.example.HelloWorld$MyRenderer.onDrawFrame(HelloWorld.java:228)
E/AndroidRuntime(24633): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
E/AndroidRuntime(24633): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
Just use the other constructor for FrameBuffer. You are using the 1.x variant in a 2.0 context, which doesn't work because the whole gl API has changed between 1.x and 2. Sadly, i can't really detect the current version, so it's left to you to do the 'right thing'.
thanks, that solved it :)
btw, does FrameBuffer.blit(Texture, ..) hold a reference to blitted Texture? I'm continously creating a bitmap, then a texture from that bitmap, and blit it and eventually end up with out of memory.
if I omit texture creation and create bitmap and blit last texture no out of memory happens
No, it holds no reference to it but it uploads it to the GPU. If you aren't using a texture any longer, you should unload it so that the memory used on the GPU will get freed.
Edit: A better solution would be to use an ITextureEffect for this though.