Author Topic: Context change  (Read 882 times)

Offline Raswr

  • byte
  • *
  • Posts: 13
    • View Profile
Context change
« on: June 05, 2013, 09:31:42 pm »
So I'm getting a crash on my app after pressing home and going back into it,

Code: [Select]
06-05 21:23:37.915: E/AndroidRuntime(28038): FATAL EXCEPTION: GLThread 43544
06-05 21:23:37.915: E/AndroidRuntime(28038): java.lang.NullPointerException
06-05 21:23:37.915: E/AndroidRuntime(28038): at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2157)
06-05 21:23:37.915: E/AndroidRuntime(28038): at com.threed.jpct.World.draw(World.java:1344)
06-05 21:23:37.915: E/AndroidRuntime(28038): at com.threed.jpct.World.draw(World.java:1085)

I've been searching but haven't found what I have to do exactly to manage gl context changes. Is the solution to load all the models from the files (serialized) again? and same goes for the textures? I thought the engine would manage re-upload of vbos and textures to the gpu, but now I don't really know, the info is a bit confusing to me.



Thank you.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12048
    • View Profile
    • http://www.jpct.net
Re: Context change
« Reply #1 on: June 05, 2013, 10:35:46 pm »
There's actually nothing you have to do manage a context change if you don't want to. The engine should handle it by itself unless you don't remove any textures or meshes. Are you doing anything like that in onPause/onStop/...?

Offline Raswr

  • byte
  • *
  • Posts: 13
    • View Profile
Re: Context change
« Reply #2 on: June 06, 2013, 12:20:33 am »
There's actually nothing you have to do manage a context change if you don't want to. The engine should handle it by itself unless you don't remove any textures or meshes. Are you doing anything like that in onPause/onStop/...?

Ok thanks Egon, for some reason I was clearing the texture manager on OnStop() and I got confused while reading some posts about the glcontext that I didn't understand :o, I should have double-checked my code first , problem solved!