LWJGL full screen not working

I am trying to add full-screen functions to my program, but I could not get it to work. I'm trying to

Display.setFullscreen(true);

I tried to change my position above where I create the screen or where I set the display mode, but still not working. Any help on this?

+5
source share
2 answers

In my experience, DisplayMode needs to be supported. You can try the following:

        DisplayMode displayMode = null;
        DisplayMode[] modes = Display.getAvailableDisplayModes();

         for (int i = 0; i < modes.length; i++)
         {
             if (modes[i].getWidth() == width
             && modes[i].getHeight() == height
             && modes[i].isFullscreenCapable())
               {
                    displayMode = modes[i];
               }
         }

After that, your Display.setFullscreen (true) should work

+8
source

I know that this question is quite (5 years) old, but there can still be people who are looking for a solution to this issue.

The easiest way:

Display.setDisplayModeAndFullscreen(Display.getDesktopDisplayMode());

. setFullscreen() .

0

All Articles