Setting new AppSettings on the fly causes crash


I’ve been using bit old nighlty (july or august, I’m not sure) and almost everything was working fine, there was only some flickering when using alpha treshold on transparent textures. So I updated to the latest nighlies and the flickering is gone, great. But I can’t change settings on the fly anymore.

Well I can, it works unless I try to change multisampling value. Then I get null pointer exception in lwjgl. I did not want to post my code here, so I took the basic blue cube example.

[java]public class JMETest extends SimpleApplication {

public static void main(String[] args){

JMETest app = new JMETest();

app.start(); // start the game



public void simpleInitApp() {

Box b = new Box(Vector3f.ZERO, 1, 1, 1); // create cube shape at the origin

Geometry geom = new Geometry(“Box”, b); // create cube geometry from the shape

Material mat = new Material(assetManager,

“Common/MatDefs/Misc/Unshaded.j3md”); // create a simple material

mat.setColor(“Color”, ColorRGBA.Blue); // set color of material to blue

geom.setMaterial(mat); // set the cube’s material

rootNode.attachChild(geom); // make the cube appear in the scene

AppSettings newSettings = new AppSettings(true);


newSettings.setResolution(1024, 768);










After running this I get:

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]


at org.lwjgl.opengl.GL11.glGetInteger(

at com.jme3.renderer.lwjgl.LwjglRenderer.invalidateState(

at com.jme3.renderer.lwjgl.LwjglRenderer.resetGLObjects(

at com.jme3.system.lwjgl.LwjglDisplay.createContext(

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(



If I change it to newSettings.setSamples(1) everything is fine…

The issue is that that when you start the app, there are checks to determine which sample values are supported so that the display doesn’t crash on boot, the same does not happen when you restart the display which is why you have the crash.

I added an issue in the tracker for this:

That’s not it, my GPU (GTX460) supports even 16 samples. I can start the app with 16 samples just fine, but once it’s running I can change the value to 1 only or this crash happens…

  • it worked with that older nightly build

    (fixed typo)

OK, I updated the issue to reflect this.

Thanks :slight_smile:

Should be fixed in SVN

It really works, thanks :slight_smile: