Android的OpenGL的问题(奇怪)奇怪、问题、Android、OpenGL

2023-09-06 02:44:39 作者:人世未谙

这是一个奇怪的。 我有一个基本的应用程序(仪表板,...)和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...

 
精彩推荐