5

I'm trying to add fullscreen functionality to my program but I couldn't get it to work. I'm trying

Display.setFullscreen(true);

I tried changing its position to above where I create the display or where I set the displaymode, but still not working. Any help about this?

4

2 に答える 2

8

私の経験から、DisplayModeはそれをサポートする必要があります。あなたはこれを試すことができます:

        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];
               }
         }

これを行った後、Display.setFullscreen(true)が機能するはずです

于 2012-09-10T13:04:11.543 に答える
2

I know this question is quite (5 years) old, but there may still be people looking for a solution to this question.

The simplest way is to do:

Display.setDisplayModeAndFullscreen(Display.getDesktopDisplayMode());

Which will put your display in fullscreen for you. No need for setFullscreen() with this either.

于 2017-01-26T22:40:38.190 に答える