Hello!
I am trying to add a live wallpaper to my dice rolling application (
DnDice, check it out:
https://play.google.com/store/apps/details?id=com.christian.bar.dndice).
The problem I am experiencing is with textures: if more than one instance of the renderer/jpct-ae is running (i.e. the one inside the dice app, the live wallpaper preview or the live wallpaper itself, let's call them "instances") the application crashes telling me that I cannot instantiate more than once a texture with the same name. Maybe this is only a symptom of a bigger problem, I don't know...
I tried to put a:
if(!textureManager.containsTexture("texture_name"))
textureManager.addTexture("texture_name", texture);
, and the app does not crash anymore, but I cannot see the background texture (but textures on the dice are still there, is this because dice also have shaders and the background texture not?).
Searching in the forum, I found that the textures are bound to a specific context in the graphics memory but inside jpct-ae their are treated as unique, is this correct?
How can I tell jpct-ae to use the same texture with more that one "instance"?
Or, how can I tell to treat every "instance" to use their own textures and instantiate one "texture_name" texture for each "instance"?
Speaking in general, what lines of code do I have to write to let more than one "instance" of an app run without errors?
A lot of people is having problems with live wallpapers, maybe it would be useful to add a sample project/tutorial with a sample live wallpaper (such as a textured cube) to help everyone use this great engine
I saw that a lot of live wallpapers use jpct-ae, so the solution is out there, please let me know, you will save a lot of headaches
Thank you for your help!
Christian