Problems with 2nd monitor activated

Started by Spezi, October 03, 2006, 13:03:47

Previous topic - Next topic

Matzon

so to test, do you still get the issue if you create a 640x480 AWTGLCanvas ?

Spezi

Quote from: "Matzon"so to test, do you still get the issue if you create a 640x480 AWTGLCanvas ?
No, runs fine.
Ich bin, ich weiß nicht wer.
Ich komme, ich weiß nicht woher.
Ich gehe, ich weiß nicht wohin.
Mich wundert, dass ich so fröhlich bin.

Matzon

k, so something must be messing up when you "approach" the secondary monitor.
I'm not sure what we can do to prevent that ?

elias

Are you using the built in java2d fullscreen feature in GraphicsDevice?

- elias

Spezi

Quote from: "elias"Are you using the built in java2d fullscreen feature in GraphicsDevice?
Never heard of that, how can I check it?
Ich bin, ich weiß nicht wer.
Ich komme, ich weiß nicht woher.
Ich gehe, ich weiß nicht wohin.
Mich wundert, dass ich so fröhlich bin.

elias

Take a loot at GraphicsDevice.setFullscreenWindow() in the javadocs. Or search for a fullscreen java2d sample to use. It should work with a Window or Frame with an AWTGLCanvas inside, but I haven't actually tried it :)

- elias

Spezi

Hmm no, this unfortunately also doesn't solve the problem.
Ich bin, ich weiß nicht wer.
Ich komme, ich weiß nicht woher.
Ich gehe, ich weiß nicht wohin.
Mich wundert, dass ich so fröhlich bin.

Spezi

Is there any chance that this issue can be solved in the next 2 days?
Else I have to implement some user request to disable any additional monitors.
Ich bin, ich weiß nicht wer.
Ich komme, ich weiß nicht woher.
Ich gehe, ich weiß nicht wohin.
Mich wundert, dass ich so fröhlich bin.

Matzon

Could you make the smallest testcase possible, then we might have a chance of figuring out whats going on?
I guess its because that you're approaching the other monitor - but I have no clue really.

Spezi

Quote from: "Matzon"Could you make the smallest testcase possible, then we might have a chance of figuring out whats going on?

There is a small version of the game wrapping: http://mitglied.lycos.de/spezi/

This is meant for a resolution of 1280x1024.

With just one active monitor this should give a blue screen, with more than one the blue background texture will not be shown and the background is white.

If I comment MainWindow:14-15 and uncomment MainWindow:16-17 the blue screen is visible in both situations, but with small borders around the window and the taskbar overlapping it.

I maybe found the problem but don't know how to fix it:
With the original width and height values comment MainWindow:42-43.
Then it also works in both situations as it should. But this imagePanel is used to display a simple image as loading screen, thus is needed.
Ich bin, ich weiß nicht wer.
Ich komme, ich weiß nicht woher.
Ich gehe, ich weiß nicht wohin.
Mich wundert, dass ich so fröhlich bin.

Matzon

I'm not sure whats going on here - however I have a small workaround for you:
In you MainWindow, if you comment out one of these lines, it all works:
gameWindow.setBounds(-1, -1, 1, 1); // Spielefenster verstecken


add(imagePanel);

elias

Ok, I fixed a bug that could cause LWJGL to confuse pixel formats and allow the GDI renderer even though only accelerated formats should be used. The fix won't help you much though, since all it does is properly detect GDI and throw an exception on the first paintGL().

I believe the real problem is caused by the fact that you set the AWTGLCanvas position outside any screen coordinates (the gameWindow.setLocation(-1, -1, 1, 1) part). You'll need to find some other way to overlay AWT stuff, I'm afraid.

- elias

Evil-Devil

THe Canvas can be overlayed with any heavyweight AWT Widget. To overlay it with any lowweight Swing Widget you have to set the Swing Widget to Heavy Weight.
JPopupMenu.setDefaultLightWeightPopupEnabled(false);    // disable leightweight 
// any widget defined within these two lines will be heavyweight and overlay the awtglcanvas
// thats extremly usefull for menus :)
JPopupMenu.setDefaultLightWeightPopupEnabled(true);     // enable leightweight

Spezi

Quote from: "Matzon"I'm not sure whats going on here - however I have a small workaround for you:
In you MainWindow, if you comment out one of these lines, it all works:
gameWindow.setBounds(-1, -1, 1, 1); // Spielefenster verstecken

add(imagePanel);

Oh well, after disabling the first one, everything's fine now. I don't know why this line was still in there, but I really appreciate your suggestion.
Sometimes a second sight just works wonders. :wink: Thank you for this one.
Ich bin, ich weiß nicht wer.
Ich komme, ich weiß nicht woher.
Ich gehe, ich weiß nicht wohin.
Mich wundert, dass ich so fröhlich bin.