MANAGED & UNMANAGED (DYNAMIC )TEXTURES IN LIBGDX (OPENGL CONTEXT LOSS)

原文链接http://www.badlogicgames.com/wordpress/?p=1073

文章意思大概:

Opengl Context Loss:incoming call、按home键、电源键、进入另一个Activity(即使是半透明的Activity,onPause了就loss了,虽然这时还能看到缓存的图片,但是Activity back回去了就没了)

Managed Textures :有固定位置  eg new Texture(Gdx.files.internal("data/bg.png"));

Unmanaged (Dynamic)Textures: 没固定位置、内容会改变  eg new Texture(pixmap);


Solution:

1.keep an in-memory copy of the original bitmap  used for the texture, apply all your draw calls to that bitmap and upload it to the texture in video ram each time.

2.store a copy on the SD-card, read that in each time you call Texture.draw(), draw the Pixmap to it, upload it to the texture and save the modified image back to the SD card.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值