我想添加一個加載屏幕到我的應用程序,因爲它需要一些時間來加載紋理。這是應用程序已恢復else語句將生效並重裝所有的東西后,我在之前做...Android:OpenGL重新加載紋理
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
super.onSurfaceCreated(gl, config);
if(firstTimeCreate) {
load(); //load settings
Assets.LoadTextures(this);
firstTimeCreate = false;}
else {
//When screen is resumed....
Assets.reloadTextures();}
這樣...我試圖把它適應這種
else {
//When screen is resumed....
Thread aThread = new Thread()
{
public void run(){
boolean once = true;
while(once)
{
Assets.reloadTexutres();
once = false;
}
}
};
aThread.start();
}
然而,現在看來OpenGL無法綁定紋理,因爲屏幕是白色的。在此方法中添加線程會出現什麼問題?在我讓OpenGL開始嘗試渲染之前,我是否需要等待所有紋理加載?如果是這樣,我怎樣才能加載一個,然後展示加載屏幕,直到其餘完成?
由於
您是否找到了異步加載紋理的方法? – droidmachine 2012-07-14 22:01:51