@ishmar wrote:
Hi,
I'm trying to get some optimizations.
In my game, I started drawing several gradients and using them as background. That worked fine with Android, but when I tested with Lumia 435 it lagged horribly.
Then I rendered gradient to a texture using http://www.cocos2d-x.org/wiki/Render_To_Texture example, and speed improved greatly.
Sadly, I noticed in android that some times that texture gets lost when user pauses game and return to it later.
My question is:
- Do I need to reload all textures when my game gets focus again? According to TextureCache::reloadAllTextures() API reference there is no need to call this method now.
- Is the texture created using the RenderToTexture example stored in TextureCache by default? If not, how should I add it? RenderTexturert->getSprite()->getTexture() returns a Texture2D pointer but Director::getInstance()->getTextureCache()->addImage() only accepts a filename or a cocos2d::Image
Posts: 6
Participants: 3