LWJGL
May 25, 2013, 13:09:52 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [BUG] DisplayModes in Archlinux with multiple Monitors  (Read 1285 times)
matheus23
Regular nerd
**
Posts: 62


« on: May 24, 2012, 13:11:13 »

I've written a little test program, to show the problem:
Code:

public static void main(String[] args) {
DisplayMode[] modes = null;
try {
modes = Display.getAvailableDisplayModes();
} catch (LWJGLException e) {
e.printStackTrace();
}
for (int i = 0; i < modes.length; i++) {
System.out.println("Found Display mode (" + i + "): w:" + modes[i].getWidth() + " h:" + modes[i].getHeight() + " bpp:" + modes[i].getBitsPerPixel() + ", " + modes[i].getFrequency() + " Hz.");
}
System.out.println();
GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
for (int j = 0; j < devices.length; j++) {
System.out.println("Awt-DisplayModes for GraphicsDevice (" + j + ")");
java.awt.DisplayMode[] awtModes = devices[j].getDisplayModes();
for (int i = 0; i < modes.length; i++) {
System.out.println("Found Awt-Display mode (" + i + "): w:" + awtModes[i].getWidth() + " h:" + awtModes[i].getHeight() + " bpp:" + awtModes[i].getBitDepth() + ", " + awtModes[i].getRefreshRate() + " Hz.");
}
}
}

That just prints out DisplayMode info from LWJGL first, then from AWT.
Thats, what it prints:

Code:
Found Display mode (0): w:2560 h:1024 bpp:24, 50 Hz.

Awt-DisplayModes for GraphicsDevice (0)
Found Awt-Display mode (0): w:1280 h:1024 bpp:-1, 0 Hz.
Awt-DisplayModes for GraphicsDevice (1)
Found Awt-Display mode (0): w:1280 h:1024 bpp:-1, 0 Hz.

LWJGL just finds the double-screen DisplayMode, which makes gaming with multiple monitors somhow really ... bad.
Logged

My github account and currently active project: https://github.com/matheus23/UniverseEngine
andre-d
Newbie
*
Posts: 5


« Reply #1 on: June 27, 2012, 12:49:08 »

I have reported a similar bug before.  I am thinking I will implement an lwjgl multiple monitor style API.  When fullscreened lwjgl also assumes that the window size is the desktop size, lwjgl also forces the window to resize to the entire desktop when fullscreening (even when using netWM). I would also like to add some methods for getting available displays as well as switching the window between them.
Logged
princec
Nerdus Imperius
*****
Posts: 1870



WWW
« Reply #2 on: June 27, 2012, 14:06:47 »

I think - correct me if I'm wrong - the thinking is that LWJGL Display means "give me all you've got", and it was geared around taking over the entire visual output of the display, especially if the display is presented to LWJGL as being one large surface. There was a school of thought that said AWT had perfectly adequate multi-monitor display APIs and if you wanted to properly utilise such displays you'd use AWT and then use Display.setParent() on an appropriate window.

So with that in mind would the simple inclusion of some hints about multimonitor usage not go quite a long way toward solving the main issues?
eg. org.lwjgl.opengl.Display.primaryDisplayOnly=true might attempt to force the Display to only consider the surface presented by the "primary monitor"

Cas Smiley
Logged

matheus23
Regular nerd
**
Posts: 62


« Reply #3 on: June 30, 2012, 03:40:08 »

It has gone further.

I'm having a new system now...

I'm only getting lots of display modes now.
But they all do not work. If I want to set the Display mode to them, and then want to make the window be fullscreen, it crashes. (Will include error log later, time pressure is on me...)

Having LWJGLXRandr=false (or sth like that...), makes all the display modes dissapear. Now I have only got the double-screen wide display mode, which is the only display mode actually working.

I have no Idea how to fix this. Propably impossible to fix, maybe driver bug, maybe the desktop configuration, I dont know.
Logged

My github account and currently active project: https://github.com/matheus23/UniverseEngine
princec
Nerdus Imperius
*****
Posts: 1870



WWW
« Reply #4 on: June 30, 2012, 04:36:35 »

That's Linux for you Smiley

Cas Smiley
Logged

matheus23
Regular nerd
**
Posts: 62


« Reply #5 on: June 30, 2012, 07:21:29 »

That's Linux for you Smiley

Cas Smiley
-_-
Still better than windows. IMO of course. Don't wanna start a flame war. Having one in JGO already Tongue
Logged

My github account and currently active project: https://github.com/matheus23/UniverseEngine
andre-d
Newbie
*
Posts: 5


« Reply #6 on: July 02, 2012, 15:59:45 »

It has gone further.

I'm having a new system now...

I'm only getting lots of display modes now.
But they all do not work. If I want to set the Display mode to them, and then want to make the window be fullscreen, it crashes. (Will include error log later, time pressure is on me...)

Having LWJGLXRandr=false (or sth like that...), makes all the display modes dissapear. Now I have only got the double-screen wide display mode, which is the only display mode actually working.

I have no Idea how to fix this. Propably impossible to fix, maybe driver bug, maybe the desktop configuration, I dont know.

If you want to fullscreen a single monitor you need to tell the window manager to do that with NetWM fullscreen.  That, or you need "meta resolutions" in your X11 config for either monitor (Nvidia does not do this by default).
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!