NPE in lwjglFogstate

Hey i just updated my SVN(JME2) version and now im getting an NPE when i try to create a fogstate in my standardgame with passes. I never got this error before i updated.



I also checked the TestQuadWater which uses a fogstate and this 1 is working fine.



The NPE occurs in the following code

public LWJGLFogState() {

      super();

      if (!inited) {

            // Check for support of fog coords.

            supportsFogCoords = supportsFogCoordsDetected = GLContext

                    .getCapabilities().GL_EXT_fog_coord;

      }

   }

GLContect.getCapabilities() returns null

Why does it no longer work ?



Hellmaster.

Are you doing this in the OpenGL thread?

The check for fog coords was recently added, so now you need to make sure to create the state inside the OpenGL thread.

Your right that was the problem it should be in the opengl thread now.



I also updated this in the wiki entry now.

http://www.jmonkeyengine.com/wiki/doku.php?id=what_calls_must_be_made_from_the_opengl_thread



Hellmaster

This is me being lazy and reusing our current way of doing things.  We'll switch to lazy initing of these variables at some point which should help.