失去的OpenGL纹理在Android中后一份简历 [英] Losing OpenGL Textures in Android after a resume
本文介绍了失去的OpenGL纹理在Android中后一份简历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的游戏运行正常,除非在我preSS的HOME按钮,然后恢复的情况。需要做再次使用纹理什么?我已经打过电话的onPause和onResume在GLSurfaceView(当活动的的onPause和onResume被称为)。
My game is working correctly except in the case where I press the HOME button then resume. What needs to be done to use the textures again? I have tried calling onPause and onResume on the GLSurfaceView (when the activity's onPause and onResume are called).
任何想法我可能做错了吗?
Any ideas what I could be doing wrong?
推荐答案
如果一切都失败了,重新载入纹理:
If all else fails, reload the textures:
伪code
for tex in textures:
if glIsTexture(tex.opengl_name) == false:
glGenTextures(1, &tex.opengl_name)
glBindTexture(tex.texture_target);
glTexImage(..., texture.image);
这篇关于失去的OpenGL纹理在Android中后一份简历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文