Does Application.restart() support changing the color bit depth or anti aliasing samples? When I try to change change either of these via settings.setBitsPerPixel() or settings.setSamples() and call restart() with any values other than what specified in the settings dialog will throw a NullPointerException.
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glGetInteger(GL11.java:1363)
at com.jme3.renderer.lwjgl.LwjglRenderer.invalidateState(LwjglRenderer.java:422)
at com.jme3.renderer.lwjgl.LwjglRenderer.resetGLObjects(LwjglRenderer.java:429)
at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:106)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:163)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:217)
at java.lang.Thread.run(Unknown Source)
Test Case:
public class TestReset extends SimpleApplication {
public void simpleInitApp() {
try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); }
// works
settings.setWidth(1024);
settings.setHeight(768);
// uncommenting either of these throws a NullPointerException
// at org.lwjgl.opengl.GL11.glGetInteger(GL11.java:1363)
// settings.setBitsPerPixel(32);
// settings.setSamples(2);
restart();
}
public static void main(String[] args) {
TestReset app = new TestReset();
AppSettings settings = new AppSettings(true);
app.setShowSettings(false);
app.setSettings(settings);
app.start();
}
}
Edit: Also, I’m using the nightly build from 2011-05-11.
Thanks, fixed in SVN