Class Display


  • public final class Display
    extends Object
    Display initialization utility, that can be used to find display modes and pick one for you based on your criteria.
    Version:
    $Revision$ $Id$
    Author:
    $Author$
    • Constructor Detail

      • Display

        public Display()
    • Method Detail

      • getAvailableDisplayModes

        public static DisplayMode[] getAvailableDisplayModes​(int minWidth,
                                                             int minHeight,
                                                             int maxWidth,
                                                             int maxHeight,
                                                             int minBPP,
                                                             int maxBPP,
                                                             int minFreq,
                                                             int maxFreq)
                                                      throws LWJGLException
        Determine the available display modes that match the specified minimum and maximum criteria. If any given criterium is specified as -1 then it is ignored.
        Parameters:
        minWidth - the minimum display resolution in pixels
        minHeight - the minimum display resolution in pixels
        maxWidth - the maximum display resolution in pixels
        maxHeight - the maximum display resolution in pixels
        minBPP - the minimum bit depth per pixel
        maxBPP - the maximum bit depth per pixel
        minFreq - the minimum display frequency in Hz
        maxFreq - the maximum display frequency in Hz
        Returns:
        an array of matching display modes
        Throws:
        LWJGLException
      • setDisplayMode

        public static DisplayMode setDisplayMode​(DisplayMode[] dm,
                                                 String[] param)
                                          throws Exception
        Create the display by choosing from a list of display modes based on an order of preference. You must supply a list of allowable display modes, probably by calling getAvailableDisplayModes(), and an array with the order in which you would like them sorted in descending order. This method attempts to create the topmost display mode; if that fails, it will try the next one, and so on, until there are no modes left. If no mode is set at the end, an exception is thrown.
        Parameters:
        dm - a list of display modes to choose from
        param - the names of the DisplayMode fields in the order in which you would like them sorted.
        Returns:
        the chosen display mode
        Throws:
        NoSuchFieldException - if one of the params is not a field in DisplayMode
        Exception - if no display mode could be set
        See Also:
        DisplayMode