Fullscreen troubles

It’s probably caused by wrong frequency being set. However, when I force resolution, like 800x600 and force frequency like 65, it works fine. But I don’t want to do that, I want people being able to set any resolution they want in settings screen.



When I set fullscreen option in settings window, it would run fullscreen flawlessly. But when I won’t, and set custom resolution, other than forced 800x600, the fullscreen switch, located at F11 key, doesn’t work. It crashes with “Unable to find fullscreen display mode matching settings”. That’s probably because of wrong setting of frequency (I’ve checked it and it’s most likely the cause), but I don’t know how to get right frequency for current game’s resolution so switching fullscreen will always work.



Here’s my GoFullscreen method that does switching:

[java]private void GoFullscreen() {

AppSettings st = getSettings();

st.setFullscreen(this.fullscreen);

st.setFrequency(65); //forcing frequency, currently valid only for 800x600

setSettings(st);

app.restart();

}[/java]



Let me reiterate - it DOES work for 800x600, but for any other resolution it crashes, because of wrong frequency. Unfortunately I don’t know how to get valid one.

@memonick said:
I guess that's the window that pops up when you run the game, right?


Exactly.

Everything he asked is already there. With a little sleuthing you can get all the answers...

65 seems like a really strange frequency. Have you tried the standard 60?

Yes, and it doesn’t work for any res.

Make sure you use the “32bpp” setting, the 16bit one fails on modern cards. Also make sure you only specify resolution combinations that actually appear in the settings window, not all drivers support all resolutions.

@dariuszg-jagielski said:
Yes, and it doesn't work for any res.

Maybe that works on some resolution on YOUR monitor, it sure wouldn't work on mines. They support 120, 60 or 59. Anything else could potentially break the monitor, crash the app, etc.

Your app should NEVER force resolution that are not supported by the monitor. You could be liable if it was proven your app did that and broke a monitor. Query the drivers (or the settings), as Normen mentions.

Yes, but how to detect proper frequency for card/monitor the game is run on? So it’ll work properly?

Which part didn’t you understand?


@normen said:
Also make sure you only specify resolution combinations that actually appear in the settings window, not all drivers support all resolutions.


I said:
Query the drivers (or the settings), as Normen mentions.

Yes, but HOW?

UTSL, the settings window manages somehow doesn’t it?

Java has an API for querying supported resolutions in the AWT package I believe.

If only the source code was available so users could see what the settings dialog does to build its list. Oh… wait… o_0

1 Like

If I’m not mistaken, you could use this:



[java]GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

DisplayMode modes[] = device.getDisplayModes();

for (int i=0; i < modes.length; i++){

System.out.println(modes.getHeight() + “,” + modes.getWidth() + “,” + modes.getBitDepth() + “,” + modes.getRefreshRate());

}[/java]



Then, you get the Refresh Rate for the recommended/supported FPS, no?

http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/desktop/com/jme3/app/SettingsDialog.java

I guess that’s the window that pops up when you run the game, right?

Hi, I have a problem with Fullscreen:

After starting a debug session, when checking the “Fullscreen?” box it says 1920x1200, 24 bpp, ???, Disabled. Why are there question marks? Also, I cannot select anything else and when I hit OK, it comes up with an error: “Your monitor claims to not support the display mode you’ve selected. The combination of bit depth and refresh rate is not supported.”

I’m using Ubuntu 12.04 with the proprietary NVIDIA drivers. Also, I’m using jMonkeyEngine 3.0RC2.

No Fullscreen mode is a major show-stopper for me and makes me consider not using JME for my game at all even though I really like the API.

Other display modes work fine, it’s just Fullscreen.

Thats not the issue, use 32bpp bit depth, as the error message suggests.

How is 24bbp still a thing? Actually, I don’t think it’s ever been a thing.