Hello
According to the examples, the textures are typically loaded within the surfaceChanged method of the "GLSurfaceView.Renderer" implementation.
My concern is when loading the textures takes a lot of time, and I want to do it only once when the application starts.
If I am trying to load the textures elsewhere, what happens is when pausing/resuming the app, the surfaceChanged is called, the frame buffer is disposed, and a new frame buffer is generated.
The textures are removed from the GPU once the frame buffer is disposed, although they remain within the TextureManager.
It is possible to "re-add" the textures by doing something like:
TextureManager tm = TextureManager.getInstance();
for (String s : myTextures)
{
tm.replaceTexture(s, tm.getTexture(s));
}
Iterating through the textures I've previously added and replacing them with themselves, which causes reloading them to the GPU (I store the textures names in a list. Actually, the list of all textures can also be extracted from the TextureManager itself..).
This is a bit weird. Is this the best way to so? I guess not..
I am actually trying to "re-load" the textures which where already added to the TextureManager to the GPU again for proper rendering of my objects ....
What is the best approach to do so?
Thanks
A.P.