在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."

更多相关文章

  1. Android四大组件之~~Service
  2. android 4.4 设置默认日期格式
  3. Android获取前台进程包名
  4. android 后台长时间执行周期性定时任务 解决方案收集
  5. Android(安卓)OnLowMemory和OnTrimMemory
  6. android后台运行服务,加验证
  7. Android(安卓)之如何优化 UI 渲染(下)
  8. android以后台service的方式获取GPRS数据
  9. android性能优化之布局优化

随机推荐

  1. Android面试看重你什么?(推荐!!!)
  2. 另一个视角搞android——《Android软件安
  3. 深入Android【一】—— 序及开篇
  4. 你想加入IT高薪就业的队伍吗?还在犹豫什么
  5. Android(安卓)屏幕元素层次结构
  6. MDCC印象之三:Android热的背后
  7. Frida官方手册 - 在Android上使用Frida
  8. Android设备的唯一ID
  9. 简单聊一下Android音频通路的切换
  10. (1) Android中Binder调用流程 --- 匿名和实