Added SHIFT-F in WindowCreationTest to do a complete fullscreen toggle

This commit is contained in:
Elias Naur 2005-03-23 09:56:22 +00:00
parent ee668cf9de
commit cf978fcf1a
1 changed files with 12 additions and 2 deletions

View File

@ -218,6 +218,15 @@ public class WindowCreationTest {
// check for fullscreen
if (Keyboard.getEventKey() == Keyboard.KEY_F) {
try {
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ||
Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
System.out.println("Performing Display.destroy()/create() cycle");
DisplayMode saved_mode = Display.getDisplayMode();
Display.destroy();
Display.setDisplayMode(saved_mode);
Display.setFullscreen(fullscreen = !fullscreen);
Display.create();
} else
Display.setFullscreen(fullscreen = !fullscreen);
} catch (LWJGLException lwjgle) {
lwjgle.printStackTrace();
@ -270,7 +279,8 @@ public class WindowCreationTest {
"ARROW Keys:\tMove window when in non-fullscreen mode\n" +
"L:\t\tList selectable display modes\n" +
"0-8:\t\tSelection of display modes\n" +
"F:\t\tToggle fullscreen");
"F:\t\tToggle fullscreen" +
"SHIFT-F:\t\tToggle fullscreen with Display.destroy()/create() cycle");
WindowCreationTest wct = new WindowCreationTest();
if (wct.initialize()) {