Hello, in my game, when I try to either clone a model twice, or load the same model twice, I get a crazy null pointer exception relating to LWJGLTextureState:
java.lang.NullPointerException
at com.jme.scene.state.lwjgl.LWJGLTextureState.<init>(Unknown Source)
at com.jme.renderer.lwjgl.LWJGLRenderer.createTextureState(Unknown Source)
at com.jme.scene.Geometry.<init>(Unknown Source)
at com.jme.scene.TriMesh.<init>(Unknown Source)
at com.jmex.model.XMLparser.JmeBinaryReader.readBegining(Unknown Source)
at com.jmex.model.XMLparser.JmeBinaryReader.loadBinaryFormat(Unknown Source)
at com.jmex.model.XMLparser.JmeBinaryReader.loadBinaryFormat(Unknown Source)
It loads fine the first time but the second time it does not load. This happens with both 3DS models and Milkshape models. However, when I run jme's TestModelClones, everything works fine. This leads me to believe the problem is on my end... probably an image problem.
Each model loads its texture's from a JPG RGB, 72 DPI file (512x512). I have a Radeon 9000 Pro card, and am running OS X 10.4.
Using debug output (read: System.out.println everywhere) from within the constructor to LWJGLTextureState I was able to isolate the line where it crashes, it is right after the call to super():
super();
supportsMultiTexture = (GLContext.getCapabilities().GL_ARB_multitexture && GLContext.getCapabilities().OpenGL13); // crashes on this line!
Any help with this problem would be GREATLY appreciated as it is holding back the further development of my game.