CCRenderTexture 从后台进入前台变黑的处理(android)
2014-01-27 10:53
375 查看
在android 中使用CCRenderTexture发现一个bug,
当任务从前台切换到后台,再从后台切换到前台时CCRenderTexture渲染的对象会变成黑色。
修正:
在CCPlatformMacros.h中找到
#define CC_ENABLE_CACHE_TEXTURE_DATA 1
将1改成0即可解决
帮助信息:
"Certain Qualcomm Andreno gpu's will retain data in memory after a frame buffer switch which corrupts the render to the texture. The solution is to clear the frame buffer before rendering to the texture. However, calling glClear has the unintended result of clearing the current texture. Create a temporary texture to overcome this. At the end of CCRenderTexture::begin(), switch the attached texture to the second one, call glClear, and then switch back to the original texture. This solution is unnecessary for other devices as they don't have the same issue with switching frame buffers."
当任务从前台切换到后台,再从后台切换到前台时CCRenderTexture渲染的对象会变成黑色。
修正:
在CCPlatformMacros.h中找到
#define CC_ENABLE_CACHE_TEXTURE_DATA 1
将1改成0即可解决
帮助信息:
"Certain Qualcomm Andreno gpu's will retain data in memory after a frame buffer switch which corrupts the render to the texture. The solution is to clear the frame buffer before rendering to the texture. However, calling glClear has the unintended result of clearing the current texture. Create a temporary texture to overcome this. At the end of CCRenderTexture::begin(), switch the attached texture to the second one, call glClear, and then switch back to the original texture. This solution is unnecessary for other devices as they don't have the same issue with switching frame buffers."
相关文章推荐
- 某些手机(Andreno gpu)上gpu渲染异常的问题。(文章原题:CCRenderTexture 从后台进入前台变黑的处理(android))
- [Android界面] 如何监听android程序进入后台,和恢复到前台???
- Android监听程序进入后台,或者恢复到前台
- android 监听app进入后台以及从后台进入前台
- 如何监听android程序进入后台,和恢复到前台
- Android监听程序进入后台,或者恢复到前台
- CCApplicationProtocol(以下纯虚:应用开始函数applicationDidFinishLauncing-负责初始化导演场景、应用进入后台、前台函数、帧数设置函数、得到当前语言、平台
- 如何监听android程序进入后台,和恢复到前台???
- Android监听程序进入后台,或者恢复到前台
- Android 程序进入后台 恢复到前台
- Android监听程序进入后台,或者恢复到前台
- Android游戏开发19:SurfaceView运行机制剖析--处理切换到后台再重新进入程序时的异常
- Android监听程序进入后台,或者恢复到前台
- Android监听程序进入后台,或者恢复到前台
- Android 监听应用是否进入后台 或者恢复前台
- Android 从后台进入前台
- Android监听程序进入后台,或者恢复到前台
- Android监听程序进入后台,或者恢复到前台
- Android 后台播放FM或者Music,前台进入VideoPlayer再退出,后台不能恢复
- Android SurfaceView运行机制剖析--处理切换到后台再重新进入程序时的异常