Hi, I already asked that question in the libgdx forum but got no response. post: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=14985
So maybe someone of you know what we are doing wrong. Has to be something stupid because I never had this error before.
Somehow the textures are mixed sometimes
How it looks like:http://mineforce.de/img/Screenshot_2014-06-20-21-39-43.png
How it should look like:http://mineforce.de/img/Screenshot_2014-06-20-21-40-29.png
On Nexus 5: It seems like that the texture of the bitmapfont replaced the triangle etc.
On samsung s1: The textures are black and/or mixed:
1. Start after installation
2. Restart (if the app wasn't closed using the taskmanager)
So it seems like that those textures are disposed/the content is lost.
That "content-loss" also happens in different situations. It seems a bit random sometimes.
How we are creating scene2d-elements:
new Image(new Texture(Gdx.files.internal(...)));
Sometimes we are creating Drawables like:
Drawable drawable = new Image(new Texture(Gdx.files.internal(...))).getDrawable();
Image image1 = new Image(drawable);
Image image2 = new Image(drawable);
Image image3 = new Image(drawable);
I already read that: http://www.java-gaming.org/index.php?topic=32179.0
(and everything else I found on google searching "libgdx content loss")
but as this blog post says: http://www.badlogicgames.com/wordpress/?p=1073
In case of managed textures you might have noticed that to construct such a texture you always specify a FileHandle (Graphics.newTexture( FileHandle file, …)). That’s the secret to managed textures. They recognize when the OpenGL context was lost and automatically reload the texture from the file formerly specified via the FileHandle. If i’d allow you to draw to such a texture via Texture.draw(Pixmap) i’d have a bit of a problem. I’d have to keep track of your changes to the texture. I could not just reload the original file as all subsequent changes via the draw() calls you make would be lost since i can’t write the changes to the original file.
There shouldn't be a problem
We are using the current nightly version
thx for help
Textures were mixed because of native dialogs (android). We called
in the listener of the dialog provided by android. But as they run in a different thread that has gl context (not sure how it's called) it didn't throw an error BUT the textures were created in that different context. But as I am no gpu guru I don't know what really happens
After creating a queue and running the code on the mainThread it worked.