Author Topic: onSurfaceCreated(..)  (Read 3907 times)

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
onSurfaceCreated(..)
« on: March 31, 2010, 09:57:05 pm »
hi,

javadocs state that, when GL surface is lost, all OpenGL resources -such as textures- are also lost. does this mean Object3D's are also lost and need to be loaded/created again ? or is it
enough to reload textures and set them on objects ?

thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: onSurfaceCreated(..)
« Reply #1 on: March 31, 2010, 10:11:35 pm »
Should be enough as long as you don't strip() the Object3Ds and are not using VBOs. I've never tried it though..

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: onSurfaceCreated(..)
« Reply #2 on: March 31, 2010, 11:11:08 pm »
yeap, it works ;D but onSurfaceChanged(..) is called on the way, so the dummy ITextureEffect hack is necessary. quite handy and fast for handling activity lifecycle events.

maybe you can add saveTexturesNames()/restoreTextures() methods to Object3D. so complex objects with many textures can be also restored.
ie: in saveTexturesNames() it will take texture names from TextureManager and in restoreTextures() it will set polygon textureId's with new id's.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: onSurfaceCreated(..)
« Reply #3 on: April 01, 2010, 07:29:01 am »
I'll look into that texture name thing next week.