Fullscreen switch broken in 1.1.3

Started by princec, November 21, 2007, 22:38:09

Previous topic - Next topic

princec

Since upgrading to 1.1.3 this happens now in all my games when I try and click on my "Fullscreen" button in the options screens:
Failed to set fullscreen=true due to java.lang.IllegalStateException: Only modes acquired from getAvailableDisplayModes() can be used for fullscreen display
java.lang.IllegalStateException: Only modes acquired from getAvailableDisplayModes() can be used for fullscreen display
	at org.lwjgl.opengl.Display.switchDisplayMode(Display.java:300)
	at org.lwjgl.opengl.Display.setFullscreen(Display.java:487)
	at net.puppygames.applet.Game.initFullscreen(Game.java:1220)
	at net.puppygames.applet.Game.setFullscreen(Game.java:1187)
	at net.puppygames.applet.screens.OptionsScreen.onClicked(OptionsScreen.java:157)
	at net.puppygames.applet.Area.tick(Area.java:434)
	at net.puppygames.applet.Screen.tickEverything(Screen.java:607)
	at net.puppygames.applet.Screen.tick(Screen.java:561)
	at net.puppygames.applet.Screen.tickAllScreens(Screen.java:942)
	at net.puppygames.applet.Game.tick(Game.java:1738)
	at net.puppygames.applet.Game.run(Game.java:1385)
	at net.puppygames.applet.Game.init(Game.java:667)
	at net.puppygames.applet.Launcher.main(Launcher.java:64)

whereas it didn't happen before. Any reason for this change?

Cas :)

Matzon

yes, we detect whether fullscreen is "allowed" by checking all of the display modes gotten from getAvailableDisplayModes with the win32 api - manually created displaymodes are not guaranteed to work with fullscreen, since these haven't been checked.

princec

Well, that's the funny thing, because the displaymode is of course one of those returned from getAvailableDisplayModes.

I've worked around it by explicitly changing display mode first then calling setFullScreen(true), but the idea was to get the window to cover up all the ugly display mode resizing before doing the resize.

The old behaviour was simply to make whatever window you had cover the screen at whatever resolution it is, and this behaviour seems much more intuitive.

Cas :)

elias

Being a LWJGL developer yourself you should know that a small self-contained test case is mandatory :) I don't see anything wrong with the test in Display.switchDisplayMode() so we'll need a test that uses one of the modes from getAvailableDisplayModes() and still exhibit the crash.

- elias

princec

Well, it's not a crash, just an annoyance.

The correct behaviour for setFullScreen(true) when a non-standard DisplayMode is currently in operation should be to read the current real physical display mode and set that; then make the window fullscreen over it.

Cas :)