Author Topic: ERROR: before: glError 1285  (Read 1611 times)

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
ERROR: before: glError 1285
« on: July 30, 2012, 03:07:55 pm »

Everything was ok when  my code like this:

 
Code: [Select]
Texture dogTexture = new Texture(mResources.openRawResource(R.raw.dog));  //the same texture-res
      Texture worldTexture = new Texture(mResources.openRawResource(R.raw.dog));    //the same texture-res
      Texture skyTexture = new Texture(mResources.openRawResource(R.raw.dog));       //the same texture-res

      TextureManager.getInstance().addTexture("dog", dogTexture);
      TextureManager.getInstance().addTexture("sky", dogTexture);
      TextureManager.getInstance().addTexture("world", worldTexture);

 
But crashed when i changed the codes to:

 
Code: [Select]
Texture dogTexture = new Texture(mResources.openRawResource(R.raw.dog));
      Texture worldTexture = new Texture(mResources.openRawResource(R.raw.dog));
      Texture skyTexture = new Texture(mResources.openRawResource(R.raw.dog));

      TextureManager.getInstance().addTexture("dog", dogTexture);
      TextureManager.getInstance().addTexture("sky", skyTexture);       //modified here
      TextureManager.getInstance().addTexture("world", worldTexture);


res/raw/dog is a 512*512 jpg. Crash info:

07-30 20:18:08.656: E/AndroidRuntime(10787): FATAL EXCEPTION: GLThread 10
07-30 20:18:08.656: E/AndroidRuntime(10787): java.lang.RuntimeException: [ 1343650688631 ] - ERROR: before: glError 1285
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.Logger.log(Logger.java:189)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.GL20.checkError(GL20.java:142)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.GL20.glGenBuffers(GL20.java:1312)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.CompiledInstance.compileToVBO(CompiledInstance.java:1291)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.CompiledInstance.render(CompiledInstance.java:529)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2211)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.World.draw(World.java:1307)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.World.draw(World.java:1074)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at net.wenyu.Main3DSurfaceView$MyRenderer.renderWorld(Main3DSurfaceView.java:245)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at net.wenyu.Main3DSurfaceView$MyRenderer.onDrawFrame(Main3DSurfaceView.java:145)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: ERROR: before: glError 1285
« Reply #1 on: July 30, 2012, 03:34:58 pm »
It is out of memory error, you can try to reduce texture size