Hello LWJGLians.
I am developing a game with JME on Ubuntu 10.04 64 bit. I have an ATI e4690 graphics card and two 1680x1050 TFT screens.
Now,
- I can start my application with 1680x1050 in fullscreen mode -> that just uses the first screen
- I can start my app with 3360x1050 without fullscreen -> works too but is not FS
- When I start my app in 3360x1050 with fullscreen, JME tells me "Bad display mode".
To avoid this really demotivatonal statement, the following alteration to JME code has been made so when JME cant find a close match for the DisplayMode I desire it would have just returned null, now it tries to force the DisplayMode I want (yes, I know its a mean hack):
if (best_match == -1) {
final DisplayMode mode = new DisplayMode(width, height);
logger.warning("No valid display mode found. Trying to force it");
try {
final Class<?> c = mode.getClass();
Field f = c.getDeclaredField("fullscreen");
f.setAccessible(true);
f.setBoolean(mode, Boolean.TRUE);
f = c.getDeclaredField("bpp");
f.setAccessible(true);
f.setInt(mode, bpp);
f = c.getDeclaredField("freq");
f.setAccessible(true);
f.setInt(mode, freq);
} catch (final NoSuchFieldException x) {
x.printStackTrace();
} catch (final IllegalArgumentException x) {
x.printStackTrace();
} catch (final IllegalAccessException x) {
x.printStackTrace();
}
return mode;
} // if
logger.log(Level.INFO, "Selected DisplayMode: {0}", modes[best_match]);
return modes[best_match];
That producest this log output and stacktrace:
Xrandr extension not available
XF86VidMode extension version 2.2
Using XF86VidMode for display mode switching
XF86VidMode extension version 2.2
Initial mode: 1680 x 1050 x 24 @60Hz
Removed 11 duplicate displaymodes
Dec 9, 2010 4:22:53 PM com.jme.system.lwjgl.LWJGLDisplaySystem getValidDisplayMode
WARNING: No valid display mode found. Trying to force it
Mode 0: 1680x1050 @60
Mode 1: 1440x900 @60
Mode 2: 1280x800 @60
Mode 3: 1152x648 @60
Mode 4: 1280x1024 @60
Mode 5: 1280x1024 @60
Mode 6: 1280x960 @60
Mode 7: 1280x800 @60
Mode 8: 1152x864 @60
Mode 9: 1152x864 @60
Mode 10: 1280x768 @60
Mode 11: 1280x720 @60
Mode 12: 1024x768 @60
Mode 13: 1024x768 @60
Mode 14: 1024x768 @60
Mode 15: 1024x600 @60
Mode 16: 800x600 @60
Mode 17: 800x600 @60
Mode 18: 800x600 @60
Mode 19: 800x600 @60
Mode 20: 800x600 @60
Mode 21: 800x480 @60
Mode 22: 720x480 @60
Mode 23: 640x480 @60
Mode 24: 640x480 @60
Mode 25: 640x480 @60
Dec 9, 2010 4:22:53 PM com.jme.system.lwjgl.LWJGLDisplaySystem initDisplay
SEVERE: Cannot create window
Dec 9, 2010 4:22:53 PM class com.jme.system.lwjgl.LWJGLDisplaySystem initDisplay()
SEVERE: Exception
org.lwjgl.LWJGLException: Could not switch mode.
at org.lwjgl.opengl.LinuxDisplay.nSwitchDisplayMode(Native Method)
at org.lwjgl.opengl.LinuxDisplay.switchDisplayModeOnTmpDisplay(LinuxDisplay.java:524)
at org.lwjgl.opengl.LinuxDisplay.switchDisplayMode(LinuxDisplay.java:514)
at org.lwjgl.opengl.Display.switchDisplayMode(Display.java:367)
at org.lwjgl.opengl.Display.create(Display.java:853)
at org.lwjgl.opengl.Display.create(Display.java:785)
at com.jme.system.lwjgl.LWJGLDisplaySystem.initDisplay(LWJGLDisplaySystem.java:476)
at com.jme.system.lwjgl.LWJGLDisplaySystem.createWindow(LWJGLDisplaySystem.java:148)
at com.jmex.game.StandardGame.initSystem(StandardGame.java:302)
at com.jmex.game.StandardGame.run(StandardGame.java:213)
at java.lang.Thread.run(Thread.java:662)
Dec 9, 2010 4:22:53 PM com.jmex.game.DefaultUncaughtExceptionHandler uncaughtException
SEVERE: Main game loop broken by uncaught exception
com.jme.system.JmeException: Cannot create window: Could not switch mode.
at com.jme.system.lwjgl.LWJGLDisplaySystem.initDisplay(LWJGLDisplaySystem.java:495)
at com.jme.system.lwjgl.LWJGLDisplaySystem.createWindow(LWJGLDisplaySystem.java:148)
at com.jmex.game.StandardGame.initSystem(StandardGame.java:302)
at com.jmex.game.StandardGame.run(StandardGame.java:213)
at java.lang.Thread.run(Thread.java:662)
So, to make this short, I would like to have a fullscreen game accross two identical monitors, which is not possible it seems.
I have tried it with XRANDR and XF86VidMode as DisplayMode switching thingys
I have tried it with Xinerama ON and OFF
I have tried with various resolutions, frequencies and color depths
I have tried screen setups with AMDCCLE, XRANDR and manual xorg.conf hacking
... nothing will work
The list in the log output doesnt show my fullscreen resolution. The actual desktop area is 3360x1050 but doesn't show up in the LWJGL list of compatible display modes, because it just returns the resolutions for one monitor and not for the whole screen.
Can someone help me out here?
Thanks already for even trying.