0

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?

Błażej
  • 3,617
  • 7
  • 35
  • 62

1 Answers1

0

you could write your own bitmaptextureatlas, which override the unload method and call it instant and not just on next tick of the updatehandler

Izu
  • 235
  • 1
  • 5