I'm trying to create a skybox in my class that extends PhysicsGameState and i get the error:
java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1348)
at com.jme.scene.state.lwjgl.LWJGLTextureState.load(LWJGLTextureState.java:303)
at com.jme.scene.state.lwjgl.LWJGLTextureState.apply(LWJGLTextureState.java:881)
at com.jme.scene.Skybox.preloadTextures(Skybox.java:264)
My skybox code is correct because i used it in a classe extended from SimplePassGame and worked fine.
What is the problem? I can only use skybox in simplepassgame??
Don't use the Skybox.preloadTextures() method inside the gamestate's constructor. This is a known problem and darkfrog has refused to fix it when I asked him about it 2 years ago.