Reputation: 1793
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.
Upvotes: 0
Views: 1120
Reputation: 42176
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.
Upvotes: 1