Null Pointer exception when trying to create a fogstate inside a gamestate

I get the null pointer exception inside Class

LWJGLFogState Line 67



 public LWJGLFogState() {
        super();
        if (!inited) {
            // Check for support of fog coords.
            supportsFogCoords = supportsFogCoordsDetected = GLContext // this line throws a nullpointer exception
                    .getCapabilities().GL_EXT_fog_coord;
        }
    }



Does anyone know whats going on here?

had to add it into the GameTaskQueue in order to prevent the nullpointer exception

Well usually NPE in connection with LWJGL … I say first cause is that the command was called from an incorrect thread. Try using the GameTaskQueueManager for making this call, as described in this tutorial.



Edit: heh, you figured it out yourself while I wrote this