NullPointerEx. when attempting to access any LWJGL->G11 method

Hi, I'm new to jME, but I have already made a few simple apps (It's very user friendly, with quick ramp-up)  :slight_smile:

However, I have recently tried to make a little more sophisticated app.  (One that has a StandardGame and a custom BasicGameState)

But whenever I try to initialize the game, I run into NullPointerExceptions whenever any G11 method is called (by the LWJGL wrapper)

It's as if the OGL renderer isn't initialized yet, but I don't see what I'm doing differently.

Here's the excp:

Exception in thread "main" java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glHint(
at com.jme.scene.state.lwjgl.LWJGLTextureState.apply(
at com.jme.scene.Skybox.preloadTextures(
at com.atmosfear.MyGameState.buildSkyBox(
at com.atmosfear.MyGameState.simpleInitGame(
at com.atmosfear.MyGameState.<init>(
at com.atmosfear.MyGameState.<init>(
at com.atmosfear.MyGame.main(

I copied the code from the TestIsland Example, and put all that code into my custom GameState, so that it will initialize upon creation.  Is that not correct?

Here is the code block to create my StandardGame/State:

   StandardGame game = new StandardGame("Carcassonne");

      gameState = new MyGameState(game);
      DebugGameState debugGameState = new DebugGameState();


The code in MyGameState.<init> is pretty much copied right out of the example, but with all the right variables extracted from the "game" constructor parameter.

Any help would be greatly appreciated.  (I love jME BTW)


I figured out the problem.      I had to execute the initialization in the GL thread.  Ok, all good now.