Im dynamically loading textures to objects as they need to be created in my update method but for some reason the most of the objects drawn to screen are done so without their textures. Occasionally the textures are all drawn and then suddenly they disappear and all the objects are drawn but just white. I dont notice any warnings in the logcat and the app never crashes so Im just a little lost at the moment and could use a push in the right direction.
Heres the code Im using in my updatescene method:
updateScene(){
//rotate and move stuff removed
if(!scene._children.contains(viewer.getObj(i).getBox())){
scene.addChild(viewer.getObj(i).getBox());
dataView.dataHandler.getMarker(i).addTexture();
}
and then this is the code Im using that loads textures to the box:
public void addTexture(){
if(bitmap1!=null){
try{
String bmt1 = "bmt"+this.toString();
if(!Shared.textureManager().contains(bmt1)){
Shared.textureManager().addTextureId(bitmap1,bmt1,false);
box.texturesEnabled(true);
box.textures().addById(bmt1);
//box.normalsEnabled(false);
}else if(Shared.textureManager().contains(bmt1)){
Log.w("Texture "+bmt1+" already exists","Texture "+bmt1+" already exists");
}
}catch(Exception e){
e.printStackTrace();
}
}
}
Any thoughts on why a texture would sometimes draw and sometimes not?
I figured it out. It wasnt Anything related to my min3d calls but when I was inserting the bitmap to be used as a texture the bitmap that was being used was empty holding no pixel data but not null. Kinda weird.