[BUG] Background messed up after resolution switch (Windows XP)

Started by Simon Felix, March 02, 2011, 21:13:20

Previous topic - Next topic

Simon Felix

Hi everyone

A user of our game is running Windows XP (32bit) using 1920x1080 with a nVidia GeForce 9400 GT card. He plays our game (Cultris II) fullscreen with a resolution of 1280x720. We're using LWJGL 2.7.1. Our game switches resolution using this code:

     DisplayMode[] dms=Display.getAvailableDisplayModes();
      DisplayMode dmBest=dms[_mode];
      if(!Display.getDisplayMode().equals(dmBest) || !Display.isFullscreen())
      {
        Display.setDisplayModeAndFullscreen(dmBest);
      }


When closing our application we call Display.destroy(). The user reported that when our game quits the desktop wallpaper looks weird:


He tried different versions of the graphics driver, including the latest one as of today.

Are we doing something wrong? Or can you fix this problem somehow? Is there a workaround?

Cheers,
Simon
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

Fool Running

Couple of questions:
- Does the problem still happen at 1920x1080 resolution (i.e. the desktop resolution)?
- Does the problem still happen in windowed mode (if the game can be played in a window)?
- Does he have other applications running that might be trying to use the graphics card at the same time (like a custom taskbar or something)?
- Does the same problem happen if he alt-tabs out of the game?
- Do you have a screenshot of the problem?
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

Simon Felix

Quote from: Fool Running on March 03, 2011, 14:02:38- Does the problem still happen at 1920x1080 resolution (i.e. the desktop resolution)?
No, it only happens at reduced resolutions.

Quote from: Fool Running on March 03, 2011, 14:02:38- Does the problem still happen in windowed mode (if the game can be played in a window)?
No, it only happens in fullscreen mode.

Quote from: Fool Running on March 03, 2011, 14:02:38- Does he have other applications running that might be trying to use the graphics card at the same time (like a custom taskbar or something)?
No other applications are running except for MSN.

Quote from: Fool Running on March 03, 2011, 14:02:38- Does the same problem happen if he alt-tabs out of the game?
Will ask.

Quote from: Fool Running on March 03, 2011, 14:02:38- Do you have a screenshot of the problem?
Screenshot is included in the first post. The beachy scene should be a picture without black areas or seams.
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

pihvi

Hi, I'm the one who have the problem with the desktop background.

I have two monitors attached to my graphic card, both 1920x1080. Maybe this problem is caused by nView, because I use it so I can have two different wallpapers (you can see part of the wallpaper from the other monitor to the right of the screenshot). Without nView managing my wallpapers, it seems to work fine.

The problem shows up randomly when I use Alt-Tab. Sometimes it is fixed after I exit the game, and other times the background is still messed up after I exited the game.

The smaller image on the screenshot (in the first post) has the same resolution as when I ran the game in fullscreen mode. I don't have any problems when I run in windowed mode. I have msn and firefox running, and no custom taskbars or other tweaks.

Fool Running

Quote from: dr_evil on March 03, 2011, 16:47:39
Screenshot is included in the first post. The beachy scene should be a picture without black areas or seams.
Aaack... It must be blocked by my workplace internet filter. :-\ I'll look when I get back home.

Quote from: pihvi on March 03, 2011, 17:44:02
Without nView managing my wallpapers, it seems to work fine.
That says to me that it's a problem with nView. Does it happen with any other games (DirectX or OpenGL) when not at the desktop resolution?
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

pihvi

Quote from: Fool Running on March 04, 2011, 13:32:19
That says to me that it's a problem with nView. Does it happen with any other games (DirectX or OpenGL) when not at the desktop resolution?

I will check with some other fullscreen apps in the next few days. I can see when I use nview, that it takes longer to recover the background image back to the 1920x1080 resolution. So for one or two seconds I see the background as the posted screenshot before it gets back to normal (unless it gets stuck with that mess).
I don't know how nview works, but could it have something to do that when the java program exits, it only have a short time to clean up things before it gets killed?

pihvi

I've tried a few fullscreen apps, but unable to reproduce the bug with those. And I haven't been able to reproduce it with the latest version of Cultris II. I made a little experiment in java (with no 3rd party libraries like lwjgl) where I run a JFrame in Full-Screen Exclusive Mode, and if I close it with System.exit, then I can reproduce the bug.
So my guess is that if the jvm doesn't get (enough) time to clean up and you are using nview with dual backgrounds, then this will happen.

Simon Felix

Quote from: pihvi on March 10, 2011, 18:36:41
So my guess is that if the jvm doesn't get (enough) time to clean up and you are using nview with dual backgrounds, then this will happen.

JVM doesn't even know what LWJGL does, LWJGL should always have as much time as it wants. Btw: Cultris II never quits with System.exit(0) and always calls Display.destroy();
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/