I've broken my model down in to classes that extend Node, which are then added to each other, and the scene. This works well for dividing up the code in to logical chunks. But I'm having a problem texturing the primitives inside each extended node. I've passed in the DisplaySystem object, and I can call display.getRenderer() fine, but when I then try to do renderer.createMaterialState(), I always get a null pointer exception. Why is this? Is there any way this can be got around?
I'd say it was because you aren't in the gl thread, but I don't think a call to create Material State does anything with OpenGL
But I'm in the same thread; I'm not creating any new ones myself, and it should be just as if I had one file with nodes that had stuff added to them, before being added themselves to the root. I don't really understand why this problem is occurring.
The actual trace would be helpful
Don't worry about it, I've got it figured out now. Thanks anyway.