Very simple (...) StandardGame problem


I've just started to look at jME during the last few weeks, I've never done any gaming programming before, but I'd love to try it and this seems to be the place to start.

I have created a very simple terrain block using StandardGame and GameStates, but for some reason I only get about 15 fps.

Culling the scene should improve the fps,

so I added this code:

CullState cs = display.getRenderer().createCullState();

to the constructor of the MyGameState, which extends StatisticsGameState, after setting up the working zBufferState.

I get a NullPointerException for some reason .. I guess it's somthing to do with the openGL thread, but I thought you could initiate everything without having to touch the openGL thread.

The culling works with simple game and base game, I just can't get it working with standard game!

Thanks loads ;)


Also can't get "skybox.preloadTextures();" to work with my game state :S

Here's the stack trace:

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.zimph.test.BallGameState.buildSkyBox(
at com.zimph.test.BallGameState.init(
at com.zimph.test.BallGameState.<init>(
at com.zimph.test.BallGameState.<init>(
at com.zimph.test.BallRoll.main(

You need to put skybox.preloadTextures() in the opengl thread

skyuzo said:

You need to put skybox.preloadTextures() in the opengl thread

I don't really get how do that though :S

I'll have a go, gimme a sec ...

      Future<Object> task = GameTaskQueueManager.getManager().getQueue(GameTaskQueue.UPDATE).enqueue(
              new Callable<Object> () {
                 return null;