Android的OpenGL的问题(奇怪) [英] Android opengl issue (weird)

查看:183
本文介绍了Android的OpenGL的问题(奇怪)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个奇怪的。 我有一个基本的应用程序(仪表板,...)和GLSurfaceview中,我绘制3D对象和纹理。所有运行pretty的,但是当我回去等活动,嗯以及截图优于字:

this is a weird one. I have a basic application (dashboard, ...) and a GLSurfaceview in which I draw 3D objects and textures. All runs pretty but when I go back in other activities, hmm well a screenshot is better than words:

这是仪表板之前

这是OpenGL的:

this is the opengl:

这是我的仪表盘,当我preSS回:

And this is my dashboard when I press back:

正如你所看到的图像消失了,文字也。我运行在4.0以上,所以我想这是因为Android的吸引元素和OpenGL的,因为它没有这样做对我的2.2设备。

As you can see, the images are gone and text too. I run on 4.0+ so I suppose this is because android draws elements with opengl, as it doesn't do that on my 2.2 device.

你有什么原因造成这一点的想法? 它不会发生在我不使用纹理BTW。

Do you have an idea of what is causing this? It does not happen when I don't use texture btw.

推荐答案

好吧,我发现了什么是我错了。我被删除的 UI线程纹理,通过调用 mTextureManager.deleteAllTextures()我的片段的的onPause();

Ok I found what was wrong to me. I was deleting textures on the UI Thread, by calling mTextureManager.deleteAllTextures() on my fragment's onPause();

我解决了它删除我的纹理与

I solved it by deleting my textures with a

mSurfaceView.queueEvent(new Runnable(){
    //delete all textures here
}

希望这将帮助其他人...

Hope this will help other guys...

这篇关于Android的OpenGL的问题(奇怪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆