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:
- Start after installation
- 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();
//-> use drawable to create several Images
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
There shouldn’t be a problem ???
We are using the current nightly version
thx for help
EDIT:
Fixes found:
Textures were mixed because of native dialogs (android). We called
new Texture(...)
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 ;D
After creating a queue and running the code on the mainThread it worked.