I'm wondering how I can do this? Because at the moment I use BitmapTextureAtlas.unload()
but that doesn't remove/clear data from OpenGL context. I know it because after I unload every texture in game. Then pause and resume app, when OpenGL recreate Context it take some time.
So my conclusion is that OpenGL Context still contain those data.
My code
@Override
public synchronized void onPauseGame() {
super.onPauseGame();
if (gameIsLoaded) {
Log.i("textureManager",""+getTextureManager().getTexturesLoadedCount());
Log.i("textureManager",""+getTextureManager().getTextureMemoryUsed());
atlasNumbers.unload();
atlasIcon.unload();
atlasHexagonBackground.unload();
atlasCorner.unload();
atlasCloud.unload();
// there is a lot more of unload
Log.i("textureManager",""+getTextureManager().getTexturesLoadedCount());
Log.i("textureManager",""+getTextureManager().getTextureMemoryUsed());
wasPaused = true;
}
}
Output
I/textureManager﹕ 130
I/textureManager﹕ 79834
I/textureManager﹕ 130
I/textureManager﹕ 79834
I found out that BitmapTextureAtlas.unload()
only set flag and actual unload will be performed on next onUpdate tick. Is there any to unload texture and then performe application pause?