diff options
author | Carsten Weisse <[email protected]> | 2006-12-11 22:16:06 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2006-12-11 22:16:06 +0000 |
commit | 081523f2ecfc3a03b278c1a29f26ccbcc08e72f2 (patch) | |
tree | 81d257b578852f599460cfc29f37d8fa4f039be0 | |
parent | 8d6db3172d571a9fd3303e78a4768cded9029fcf (diff) |
hope this helps on win32 screen mode switching
-rw-r--r-- | src/jake2/render/opengl/Jsr231Driver.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/jake2/render/opengl/Jsr231Driver.java b/src/jake2/render/opengl/Jsr231Driver.java index f50ee4c..a9d44e1 100644 --- a/src/jake2/render/opengl/Jsr231Driver.java +++ b/src/jake2/render/opengl/Jsr231Driver.java @@ -138,8 +138,10 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver { /* * fullscreen handling */ - GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); - device = env.getDefaultScreenDevice(); + if (device == null) { + GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); + device = env.getDefaultScreenDevice(); + } if (oldDisplayMode == null) { oldDisplayMode = device.getDisplayMode(); @@ -201,14 +203,10 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver { VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); } else { - // Not much point in having a full-screen window in this - // case - device.setFullScreenWindow(null); final Frame f2 = window; try { EventQueue.invokeAndWait(new Runnable() { public void run() { - f2.setVisible(false); f2.setLocation(window_xpos, window_ypos); f2.pack(); f2.setResizable(false); @@ -249,8 +247,11 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver { if (oldDisplayMode != null && device.getFullScreenWindow() != null) { try { - if (device.isFullScreenSupported()) - device.setDisplayMode(oldDisplayMode); + if (device.isFullScreenSupported()) { + if (!device.getDisplayMode().equals(oldDisplayMode)) + device.setDisplayMode(oldDisplayMode); + + } device.setFullScreenWindow(null); } catch (Exception e) { e.printStackTrace(); |