System:
Linux 2.6 Kernel Fedora Core 3
xorg 6.8.2
nvidia driver version 7175
Monitors 2 ViewSonic VP231wb
xorg.conf configured for dual-head span, resolution =3840 x 1200 x24 (1920 x 1200 x24 X2)
Problem:
Program cannot set a display mode when the system is configured for dual-head. When system is in single head mode everything works fine. See below output:
linux:~/lwJGLtest # java -Djava.library.path=./ -jar lwJGLtest.jar
java.lang.NullPointerException: mode must be non-null
at org.lwjgl.opengl.Display.setDisplayMode(Display.java:223)
at lwjgltest.GLfps.createWindow(GLfps.java:121)
at lwjgltest.GLfps.init(GLfps.java:129)
at lwjgltest.GLfps.run(GLfps.java:46)
at lwjgltest.GLfps.main(GLfps.java:36)
Display init code:
private void createWindow() throws Exception { // Create a window
Display.setFullscreen(fullscreen); //Set the Display to fullscreen
DisplayMode d[] = Display.getAvailableDisplayModes(); //init DisplayMode Array d and populate it with the systems availible visual modes
for (int i = 0; i < d.length; i++) { // for loop to scan the array for our requested visual mode
System.out.println(d);
if (d.getWidth() == WindowWidth // did we find the window width we wanted?
&& d.getHeight() == WindowHeight // did we find the window height we wanted?
&& d.getBitsPerPixel() == WindowDepth) { // did we find the window depth (Bpp) we wanted?
displayMode = d;
break; //jump out of our for loop
}
}
Display.setDisplayMode(displayMode); //set Display to the requested visual mode
Display.setTitle(windowTitle); //set the title of our window
Display.create(); //create and show the window
}
Is this a bug in lwJGL? It seems that the specified display mode cannot be set when the systems resolution is in a dual-head mode the same program in jogl works fine though.
any word on this?
obviously you're not getting the mode that you are targetting - check the list of modes, and determine why it isn't selected.
The only mode that is returned is 3840 x 1200 x 24
Then that's the only mode you've got it configured to allow. The joy of linux!
Cas :)
interesting i shall have to dig in deeper the answer must lie in the xorg conf, and the nvidia driver options.