Search code examples
javalibgdxfullscreendesktop

How to make LibGDX Desktop go fullscreen by default


I was wondering how to make my desktop app go fullscreen upon start-up. I am new to LibGDX and any help is greatly appreciated. Thank you.


Solution

  • Just define fullscreen field in your LwjglApplicationConfiguration:

    LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
    
    cfg.title = "yourGame";
    cfg.width = 1024;
    cfg.height = 768;
    cfg.fullscreen = true;
    
    new LwjglApplication(new ...(), cfg);