Hi all,
I'm trying to get up to date with jme 2.0 and I'm playing with texture states. I'm creating a textureState somewhere in my code like this
given that initially, ts is declared as a public attribute of my class (this class is named Rooms)
ts = display.getRenderer().createTextureState();
Texture t = TextureManager.loadTexture(
Rooms.class.getClassLoader().getResource(
"Textures/Vague_Mud.jpg"),
Texture.MinificationFilter.NearestNeighborLinearMipMap,
Texture.MagnificationFilter.Bilinear);
ts.setTexture(t);
ts.setEnabled(true);
when I check with eclipse debugger, ts is not null.
Then, later in another function (not belonging to the same class but the call is made by a function of the class Rooms) I call this textureState like this:
if (fatherRooms.t1==null){
int k=10; // so that I can put a breakpoint here with the eclipse debugger
}
mapNodes[temp.x][temp.y].getChild("floor").setRenderState(fatherRooms.t1);
//mapNodes contains a TriMesh child called "floor"
the point is that I have this javaNullPointerException if I launch the code, and in debugger, it stops at the "int k = 10;" and when within the debugger I check the content of the variable "fatherRooms.t1", I found what seems to me a normally initialized texture state with a texture in it ....
so I'm wondering if there wouldn't be an access restriction problem but I'm not sure why since this member of the fatherRooms object is public ...
any idea ?
thanks,
Adrien