When running a scene: If I press the lock button on the phone and unlock to go back to the app, all the textures get destroyed and logcat shows continuously:
IMGSRV : bufobj.c:943: glBufferSubData: No memory for object data
This issue happens only on Android, iOS works fine. I saw in the release notes that a similar bug was already fixed. Am I missing any flags/settings?
hello, Diego,
on android, you should used ->end(true) to end rendering to texture as you can see in the function below:
void CCRenderTexture::end(bool bIsTOCacheTexture);
on android, when the app enters the badkground, the texture data would lose, so the engine has cashed the texture infomation by default.
please make sure that the macro CC_ENABLE_CACHE_TEXTTURE_DATA is not 0.
for more information, you could refer to CCTextureCache,
if you could debug it, and provide more information, it will be appreciated,
I was trying to log the calls to CCRenderTexture::end() (which calls addDataTexture), but the only places that this function is called is from CCTransitionRadial.cpp,
and CCTransition.cpp. Where are the textures marked for cached on Android?
I was tracing the volatile class calls and it seems to me that sprites created via CCSprite::spriteWithFile are being cached but the ones created via CCSprite::spriteWithSpriteFrameName are not. Could be this the issue?
Just to add more information, I am using two approaches in the same scene:
Sprites created with CCSprite::spriteWithFile and added to a scene. Those are restored ok when locking/unlocking the phone
Sprites created with CCSprite::spriteWithSpriteFrameName. I just retained those sprites and didn’t add them to the scene, and I used visit() to draw their textures. Those are the one that get corrupted when locking/unlocking the phone.
Please let me know if there is any additional testing I can help you with. This is my #1 issue right now, and would really appreciate it it can get solved.