So i’ve been doing a lot of beta testing for Spoxel lately and i’ve been getting a ton of bug reports related to changing graphics settings. Whenever a player changes the options in Spoxel it reapplies everything. I’ve had spotty reports of it happening in the main menu, but i’ve been consistently able to cause it to happen in game and only when the in full screen mode. The players get the following exception:
[2018-03-02 15:53:38] [SEVERE ] [com.jme3.app.LegacyApplication] Uncaught exception thrown in Thread[jME3 Main,5,main]
org.lwjgl.opengl.OpenGLException: Invalid value (1281)
at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
at org.lwjgl.opengl.WindowsContextImplementation.setSwapInterval(WindowsContextImplementation.java:113)
at org.lwjgl.opengl.ContextGL.setSwapInterval(ContextGL.java:232)
at org.lwjgl.opengl.DrawableGL.setSwapInterval(DrawableGL.java:86)
at org.lwjgl.opengl.Display.setSwapInterval(Display.java:1129)
at org.lwjgl.opengl.Display.setVSyncEnabled(Display.java:1142)
at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:130)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:184)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Thread.java:748)
I was able to debug it slightly and found that the value it was attempting to set was vsync. The relevant section of code I am calling is:
AppSettings set = Voxelcraft.getInstance().getAppSettings();
set.putFloat("musicVolume", musicVolume);
set.putFloat("soundVolume", soundVolume);
set.setFullscreen(!windowed);
set.putBoolean("borderless", borderless);
set.putFloat("gammaValue", gamma);
set.setHeight(dispSet.height);
set.setWidth(dispSet.width);
set.putString("textureDetail", td.getSelection());
set.putString("lightingDetail", ld.getSelection());
set.putString("particleDetail", pd.getSelection());
//set.putInteger("Samples", Integer.parseInt(samp.getSelection()));
set.putBoolean("fxaa", fxaa);
set.putBoolean("ssao", ssao);
set.putBoolean("bloom", bloom);
set.putBoolean("fogEffects", fog);
set.setVSync(vsync);
set.putBoolean("showHealthbars", healthbars);
System.setProperty("org.lwjgl.opengl.Window.undecorated", borderless ? "true" : "false");
app.applyAppSettings(set);
nifty.getSoundSystem().setMusicVolume(musicVolume);
nifty.getSoundSystem().setSoundVolume(soundVolume);
nifty.enableAutoScaling(dispSet.width, dispSet.height);
nifty.resolutionChanged();
nifty.getRenderEngine().displayResolutionChanged();
//nifty.gotoScreen("optionsMenu");
applyKeybindChanges();
// if we are running apply graphics changes
if (Voxelcraft.hasState(GameState.class)) {
GameState gs = Voxelcraft.getState(GameState.class);
gs.updateGraphicsFilters();
}
element.setFocus();
screen.getFocusHandler().resetFocusElements();
nifty.resetMouseInputEvents();
I’m pretty much at my wits end on this one. I’ve toyed around with just not letting players change things like the resolution and vsync in game but i’ve had a few reports of it happening in the main menu now. Any ideas what could be going on?