Presently, JME rejects any request to set a non-full screen display mode to anything but the legal set of full screen display modes. This seems overly restrictive, particularly as I’ve discovered that Linux running in Xinerama mode happily reports only a single display mode the size of the entire multi-monitor screen which is rarely desirable, especially in windowed mode.
I propose the following patch:
Index: src/com/jme/system/lwjgl/LWJGLDisplaySystem.java
===================================================================
RCS file: /cvs/jme/src/com/jme/system/lwjgl/LWJGLDisplaySystem.java,v
retrieving revision 1.26
diff -u -p -r1.26 LWJGLDisplaySystem.java
--- src/com/jme/system/lwjgl/LWJGLDisplaySystem.java 4 Jun 2005 22:52:44 -0000 1.26
+++ src/com/jme/system/lwjgl/LWJGLDisplaySystem.java 24 Jun 2005 23:45:36 -0000
@@ -589,9 +589,14 @@ public class LWJGLDisplaySystem extends
*/
private void reinitDisplay() {
// create the Display.
- DisplayMode mode = getValidDisplayMode(width, height, bpp, frq);
- if (null == mode) {
- throw new JmeException("Bad display mode");
+ DisplayMode mode;
+ if (fs) {
+ mode = getValidDisplayMode(width, height, bpp, frq);
+ if (null == mode) {
+ throw new JmeException("Bad display mode");
+ }
+ } else {
+ mode = new DisplayMode(width, height);
}
try {
If a full screen display mode is requested, it validates it as usual, but if a non-full screen mode is requested, it simply passes it on unchecked to LWJGL. This also allows non-standard windowed mode resolutions (like 1000x500 or whatever else you might dream up if you're thinking outside the box).