In some point of my app i need to changue the texture of a polygon.
For that, i must load a bitmap from assets folder and then i pass the
bitmap to a "loadBitmap" method of my polygon that changes the
texture.
It is working fine, but i need to move the code into a thread, because
the loading time of the bitmap it's frozing my opengl polygon when
it's loading the bitmap from assets folder.
Because that i implemented a thread that it is called to change the
texture, but something is going wrong because my texture is empty
(white) when i use the thread, but it works if i dont use the thread,
this is my thread code:
public class addNextPage extends Thread
{
GL10 gl;
public addNextPage(GL10 gl) {
super();
this.gl = gl;
}
public void run()
{
super.run();
Bitmap bm=loadImage(pages.get(0));
auxSquare.loadBitmap(context, gl, bm);
squares.set(3,auxSquare);
currentPage+=1;
//vuelvo a recolocar los squares
int posCont=-2; //el primer polígono está a la izquierda, no
se ve.
for (int i=0;i<squares.size();i++){
if (squares.get(i)!=null)
squares.get(i).setPosition(posCont,0);
posCont+=2;
}
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en