onSurfaceCreated(..)

Started by raft, March 31, 2010, 09:57:05 PM

Previous topic - Next topic

raft

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

EgonOlsen

Should be enough as long as you don't strip() the Object3Ds and are not using VBOs. I've never tried it though..

raft

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.

EgonOlsen

I'll look into that texture name thing next week.