سؤال

I have tested a few values (by setting LwjglApplicationConfiguration width and height) to these values:

1920 | 1080
1024 | 768
 800 | 600

But I'm not able to get below those values while setting the fullscreen mode on.

So, what are the supported fullscreen sizes for libGDX?

EDIT 1: this is the source code trying to create new application with resolution of 600|480

public class Main {
    public static void main(String args[]) {
        LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
        cfg.title = "Asteroid";
        cfg.width = 600;
        cfg.height = 480;
        cfg.resizable = false;
        cfg.fullscreen = true;

        new LwjglApplication(new Game(), cfg);
    }
}

Which throws the following error:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't set display mode 600x480, fullscreen: true
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:131)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:131)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

On the other hand, similar code like this:

public class Main {
    public static void main(String args[]) {
        LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
        cfg.title = "Asteroid";
        cfg.width = 800;
        cfg.height = 600;
        cfg.resizable = false;
        cfg.fullscreen = true;

        new LwjglApplication(new Game(), cfg);
    }
}

Works without problem.

هل كانت مفيدة؟

المحلول

You're trying to change the resolution of your monitor to something smaller than your monitor supports. Instead of changing the actual resolution of your monitor, you should simply use a viewport with whatever resolution you want.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top