Struggling with Fullscreen mode

Hey Guys,
I don’t know whether this would rather fit into the General Section instead of graphics, but here I am :slight_smile:

I have the following Problem: I can’t set the Fullscreen Mode, lwjgl says “unable to find full screen display mode matching settings”.
The thing is: My GUI already querys the displayModes so I am certain that they are right.
If I use the SettingsDialog to run in Fullscreen Mode, I can change the Resoultion in my GUI and that works fine…

Does anybody have a clue?
It’s on Mac OS, I have to check if that’s a Mac related issue by I wonder what the Settings Dialog does different (I use .setWidth(), .setHeight(), .setBitsPerPixel(), and .setFullscreen()

Edit: Got it working. You need to set .setFrequency() as well. The DisplayMode returned 0 but in the windowed mode, it’s something like 50Hz and that crashes it…

got the same problem.

Maybe you can tell me, which setting I forgot?

My code:

        AppSettings settings =
                new AppSettings(true);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        double width2 = screenSize.getWidth();
        double height2 = screenSize.getHeight();
        settings.put("Width", (int) width2);
        settings.put("Fullscreen", true);
        settings.put("Height", (int) height2);
        settings.put("VSync", false);
        settings.put("Samples", 3);

Do you have 2+ screens ?

Exactly the same error or a slightly different error? Extremely important.

If you specify settings that don’t work on the computer that you run on you will get this error. Do you actually query the displayModes as the OP does?

And note that you can’t query for things like AA… so don’t set “Samples” if you want best compatibility… or set it to 0.

Also, an aside, is there an example somewhere that is showing to call put() directly like this versus calling setWidth(), setTitle(), etc.? If there is then we need to stamp it out because it’s not the recommended way and we shouldn’t have tutorials or examples that do it.

As of 3.0 stable, jME3 will not crash if you request more antialiasing samples than what is available, it will use the highest number that is supported by the GPU.

That’s weird because I have Mythruna users all the time that can’t run if they set AA. I don’t remember the error off the top of my head but it was something like “could not attach framebuffer” or something… or maybe it was the “pixel format not supported” error.

Oh that’s right, this check is not performed if you use the FilterPostProcessor …

      Do you have 2+ screens ?

I don’t know, weather I got your question right, I got one screen on my MacBook, and the application contains 2 windows, one for menu and one for 3D in fullscreen - which has this settings.

On Windows and Linux it works, by the way. But on Linux fullscreen is not always active while running the game, some times it works, sometimes not.

Also, an aside, is there an example somewhere that is showing to call
put() directly like this versus calling setWidth(), setTitle(), etc.?

Well, I will keep this in mind. I try change this to setWidth etc. and will post you the result.

I changed this parameters and also set Samples to 0.
But the problem that i can’t run in fullscreen stays. If I change to windowed Mode everything is fine. Maybe the Problem is in Apples new Yosemite-System? They have a very special new fullscreen mode…

By the way: Is it possible to make a resizable 3D-Window? That can be controlled in size by the window-knobs?

You didn’t read my edit properly. TrY setFrequency(0); as thst that is what the displaymodes return.

I first thought this means any or is a Bug but you def need zero there.

Edit: aaand i am running lion

I got a new monitor full HD and I found the same problem. Windows 7 64bit, worked well with the previous monitor. The splash configuration sets 25Hz as default, and to avoid the crash I need to manually set another frequency or run windowed mode.

As I said above, you HAVE TO specify settings that your display system (that is the combination of monitor, graphics card and OS driver) supports.

If I try to run the simplest application:

And then I click on “full screen”, I get this error. So I assume that either:

  1. the code on the tutorial is bugged
  2. there’s a bug on JME


Or your graphics card driver is not supporting the settings you are giving it… which is what this error indicates.

The HelloSimpleApplication show me the setting dialog. If I click “full screen” then the Refresh rate defaults to 25Hz.

Then I click start and I get this:

gen 30, 2015 11:47:32 AM handleError
Grave: Failed to create display
org.lwjgl.LWJGLException: Failed to set display mode (-2).
at org.lwjgl.opengl.WindowsDisplay.nSwitchDisplayMode(Native Method)

Then you graphics driver (or the java vm in combination with it) wrongly reports a non working frequency.

Unfortunately the user will either blame the game (if end user) or jme (if developer) for this

Could this be LWJGL’s fault?